Page MenuHomePhabricator

"Undelete all revisions of the associated talk page" not working
Closed, ResolvedPublicBUG REPORT

Description

I realised after processing a refund request on enwiki the talk page had not been undeleted. I assumed I had just forgotten to tick "Undelete all revisions of the associated talk page" then noticed the issue had happened with many of my previous undeletes. To make sure I had not just had a period of brain-fog I tested on a test page and had the same issue.

It appears it does not always fail, or not for everyone, as I noticed others had recently undeleted a page and the talk page was the immediate next action. Although they appear to be using the RFUD-helper script rather than the native undelete interface.

I asked on Discord and another admin said they had noticed it today (also on enwiki).

Windows 10; Firefox and Chrome

Event Timeline

taavi subscribed.

Tagging MWI per Developers/Maintainers.

I just did a test swapping to Vector 2022 and no custom scripts in common.js just to confirm the bug in a more base setup. Still failed.

I did a network trace and the call to htps://en.wikipedia.org/w/index.php?title=Special:Undelete&action=submit and noticed that the parameter undeletetalk was blank

image.png (469×289 px, 15 KB)

I have not worked with much php in my life but I'm assuming looking at the code that the constructor for CheckboxInputWidget for this control is missing 'value' => '1' ?

Possibly a regression from rMW843424abd6f2: SpecialUndelete: Prompt for reauth after undelete then? That replaced a getCheck(), which just checks the key is there in the data, with an explicit !empty() check (which an empty string would fail).

sbassett moved this task from Incoming to In Progress on the Security-Team board.
sbassett added a project: SecTeam-Processed.
sbassett added subscribers: Mstyles, sbassett.

Assigning to @Mstyles to review, as they will be back this week.

Change #1346786 had a related patch set uploaded (by Mstyles; author: Mstyles):

[mediawiki/core@master] SpecialUndelete: Fix the checkbox that undeletes the talk page

https://gerrit.wikimedia.org/r/1346786

@taavi you are right, the reauth work caused a regression. I hope that you can review my patch when you get a chance. @KylieTastic I know you said you don't have much PHP experience, but you are welcome to review and I can also create a patchdemo if you want to test the changes yourself.

@taavi you are right, the reauth work caused a regression. I hope that you can review my patch when you get a chance. @KylieTastic I know you said you don't have much PHP experience, but you are welcome to review and I can also create a patchdemo if you want to test the changes yourself.

I had already looked at the patch you posted and it looks good to me. The 'value' => '1', was what I had thought it was anyway and the other change, setting $this->mUndeleteTalk, also looks correct.

I did start setting things up to work on the code and test locally, but I've not been very well since I posted this so haven't got around to it. My day job is Windows, .Net, T-SQL and it's been a few years (15?) since I've done Linux, PHP, MySql but I have meant to get involved more in the software side. Happy to test any demo if that would help.

Test wiki created on Patch demo by MStyles (WMF) using patch(es) linked to this task:
https://47c28b4723.catalyst.wmcloud.org/w/

@KylieTastic you can use the following patch demo url to test - https://47c28b4723.catalyst.wmcloud.org/w/ and login with username Patch Demo and password patchdemo1 to test. That user is an admin so you should be able to delete and undelete pages there.

@Mstyles I tested and it worked, I also checked the network trace was undated as I expected, and also just to be thorough I tested with a few skins just for completeness and not because I could see anyway that could effect it.

So code change looks good, and tests pass. I'm happy with it. Thanks

@taavi you are right, the reauth work caused a regression. I hope that you can review my patch when you get a chance.

No, I do not plan to spend my free time reviewing LLM-generated patches.

Test wiki on Patch demo by MStyles (WMF) using patch(es) linked to this task was deleted by Catalyst admin via Cron DeleteExpiredWikis:

https://47c28b4723.catalyst.wmcloud.org/w/

Change #1346786 merged by jenkins-bot:

[mediawiki/core@master] SpecialUndelete: Fix the checkbox that undeletes the talk page

https://gerrit.wikimedia.org/r/1346786