Page MenuHomePhabricator

Cite's use of dynamic Parser::$extCite should be rewritten/removed
Open, Needs TriagePublic

Description

There's no guarantee on identity on the specific parser objects used during article pass. With both async fragment rendering as well as the Parsoid/Parser migration (which may cause different parts of the page to be variously rendered using the new Parsoid or legacy parser), the actual Parser objects seen may be different for different instances of an extension tag on the same page.

When PHP 8.2 disallowed dynamic property creation, the following error was given (T324901):

Deprecated: Creation of dynamic property Parser::$extCite is deprecated in /var/www/wiki/mediawiki/extensions/Cite/src/Hooks/CiteParserTagHooks.php on line 94

This was "fixed" by allowing dynamic properties on the Parser class, but this fix should eventually be reverted once the underlying usage in Cite is removed.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1191752 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/Cite@master] Remove use of Parser::$extCite

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

Change #1191752 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] Remove use of Parser::$extCite

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

The patch sets removes the need of a property on the Parser instance, it does not analyse or handle the possible impact on fragmentation parsing as part of the description:

There's no guarantee on identity on the specific parser objects used during article pass. With both async fragment rendering as well as the Parsoid/Parser migration (which may cause different parts of the page to be variously rendered using the new Parsoid or legacy parser), the actual Parser objects seen may be different for different instances of an extension tag on the same page.

It seems the Cite class holds state for parsing (like $inRefTag or $inReferencesGroup), not sure if that should be handled with this task or a new one.

Change #1196731 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] parser: Remove deprecated Parser::$extCite property

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

Change #1196731 merged by jenkins-bot:

[mediawiki/core@master] parser: Remove deprecated Parser::$extCite property

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