Page MenuHomePhabricator

API: 'section' parameter handling for prop=revisions is broken on PHP 8.0
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):
On a wiki running PHP 8.0 or newer, attempt to edit a talk page with the 2017 wikitext editor using the "Add topic" entrypoint.
Under the hood, this makes an API call like https://www.mediawiki.org/w/api.php?action=visualeditor&format=json&paction=wikitext&page=User_talk%3ATK-999&uselang=en&formatversion=2&section=new, which under the hood calls the equivalent of https://www.mediawiki.org/w/api.php?action=query&prop=revisions&revids=2471355&rvslots=main&rvsection=new&rvprop=content|ids.

What happens?:

Observe an error like There is no section new in revision 422.

What should have happened instead?:

The editor should have initialized with appropriate content.

Software version: 1.37

Event Timeline

Change 858602 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/core@master] Parser: Fix extractSections() behavior for PHP >= 8.0

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

Change 858602 merged by jenkins-bot:

[mediawiki/core@master] Parser: Fix extractSections() behavior for PHP >= 8.0

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

Change 860499 had a related patch set uploaded (by Reedy; author: TK-999):

[mediawiki/core@REL1_39] Parser: Fix extractSections() behavior for PHP >= 8.0

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

Change 860499 merged by jenkins-bot:

[mediawiki/core@REL1_39] Parser: Fix extractSections() behavior for PHP >= 8.0

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

Umherirrender added subscribers: Reedy, Umherirrender.

Should be backported to 1.35 and 1.38 as well?

I would assume both should support php8.0

Should be backported to 1.35 and 1.38 as well?

I would assume both should support php8.0

Probably. With 1.39 being out, backporting PHP 8 fixes to 1.35 (as an LTS) is getting a little to diminishing returns. There have been some parsoid (and/or sub library) fixes which are not trivially backported.

1.35 is supported for another ~9 months, 1.38 for ~6 months.

Change 876288 had a related patch set uploaded (by Reedy; author: TK-999):

[mediawiki/core@REL1_35] Parser: Fix extractSections() behavior for PHP >= 8.0

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

Change 876289 had a related patch set uploaded (by Reedy; author: TK-999):

[mediawiki/core@REL1_38] Parser: Fix extractSections() behavior for PHP >= 8.0

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

Reedy assigned this task to TK-999.

Change 876288 merged by jenkins-bot:

[mediawiki/core@REL1_35] Parser: Fix extractSections() behavior for PHP >= 8.0

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

Change 876289 merged by jenkins-bot:

[mediawiki/core@REL1_38] Parser: Fix extractSections() behavior for PHP >= 8.0

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