Page MenuHomePhabricator

userOptions.php --delete --old '' deletes all rows
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

Use the userOptions.php script is used with --delete --old '' (delete all rows with up_value equalling an empty string). A specific example:

Command
urbanecm@deployment-mwmaint02:~$ mwscript userOptions.php --wiki=enwiki --delete --old ''  --fromuserid=11941 --touserid=11943 --nowarn 'echo-subscriptions-web-reverted'                                                                           
Done! Deleted 1 rows.
urbanecm@deployment-mwmaint02:~$

What happens?:

All rows with matching up_property were deleted.

What should have happened instead?:

Only rows where up_value = '' were deleted.

Event Timeline

Change 991577 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/core@master] userOptions: Use hasOption( 'old' ) instead of if ( $old )

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

Change 991577 merged by jenkins-bot:

[mediawiki/core@master] userOptions: Use hasOption( 'old' ) instead of if ( $old )

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