Page MenuHomePhabricator

Wrong error message for Extension:MassEditRegex when RegEx has error
Open, Needs TriagePublic

Description

Currently, when the regular expression in the "Search For" field contains an error, the error message states that all of the pages to edit can not be found.

For example in the field "Pages to edit" is just the line

Sandbox

listed, in "Search for:" is the RegEx

/http://old.example.org/

instead of the correctly escaped /http:\/\/old\.example\.org/ (not escaping the dots will not result in an error, but potentially in wrong matches) and in "Replace with:" with have

http://new.example.org

Pressing now Execute or Show preview will give the error message

Edit failed: 
     * Sandbox does not exist

(even though the page exists). It doesn't matter how many other correct regular expressions there are, as soon as one of them has an error, all of the listed pages are listed as non existing.
It would be much more useful if the Extension were to tell the user that there is an error in the regular expressions (preferable also which of the regular expressions contains the error and at what position of the string, as this will greatly reduce the debug time.)

Tested in MW 1.25.1 (MassEditRegEx 8.0.0, PHP 5.5 ) and MW 1.26.2 (MassEditRegEx 8.0.2, PHP 5.4)

MassEditRegex_bug_error_message.png (763×640 px, 32 KB)