Page MenuHomePhabricator

opening special page "Edit multiple pages for template" lists every page twice, gives buggy dropdowns, and edits are not saved
Closed, ResolvedPublic

Description

MediaWiki: 1.32.0
PHP 7.2.11 (cgi-fcgi)
MySQL 5.7.25-log
Page Forms 4.5 (23baaf7) 2019-04-15T20:31:43

Special page "Edit multiple pages for template" works fine for at least one of our templates.

We have a series of pages that call several templates, two of which are called "{{Person}}" and "{{PersonAutolister}}". The pages are set up to be edited by a form "Person" which also manages some other templates on these pages. It's not a very clean setup that sort of grew over time.
Essentially, Person encodes data and lists part of it at the beginning of the page, "{{PersonAutolister}}" lists other content at the end of the page, some of it based on data encoded in "Person".

When I try to "Edit multiple pages for template" for template "Person" every page is sort of listed twice.
The first listing is the expected listing of a page that uses the template. The second listing appends "Autolister" to the end of the page name.

  • Tina Tenbergen ...
  • Tina TenbergenAutolister ...

It appears that "edit multiple..." appends the final part of the other template name to the pagename.

When I actually go into a row of data, it turns the table look into fields. Some are dropdowns, many are text, etc. The dropdowns don't contain the options they should, as in the ones they do when using the form with a single page.

When I attempt an edit such as entering data into a field, once I press enter or click the green checkmark, the field is blanked out and I get a message "update successful". However, data is not saved.

If I take out the call to PersonAutolister, the second listing goes away. The colomn / field types still don't seem right. This time the edit gets saved but does not put the values in the correct template parameters.

Nothing is written to .php or apache error logs. I have turned on debugging and nothing useful shows in the debug tab there either (no errors or warnings).

Event Timeline

Sorry about that! I'm guessing that the problem is due to "Person" being a substring of "PersonAutolister". The code (I'm guessing) looks for the string "{{Person" in pages, and is accidentally matching on calls to the other template as well. If that's the case, the parsing needs to be improved.

Change 605542 had a related patch set uploaded (by Sahajsk; owner: Sahajsk):
[mediawiki/extensions/PageForms@master] Improve parsing to match only the called templates in multi page edit

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

Change 605542 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Improve parsing to match only the called templates in multi page edit

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

Yaron_Koren claimed this task.

I think this is fixed, so I'm marking it as "Resolved"... feel free to re-open if not.