Universal-Omega / PortableInfobox

GNU General Public License v3.0
12 stars 11 forks source link

Infoboxes do not render properly under Parsoid #129

Open BlankEclair opened 2 months ago

BlankEclair commented 2 months ago

https://publictestwiki.com/wiki/User:BlankEclair/Sandbox/Egg:

https://rainverse.wiki/wiki/Rainbow:Dragon_Rain_13:_Hands:

BlankEclair commented 2 months ago

I added a debug print to PortableInfoboxParserTagController::renderInfobox() (which is the earliest that the extension can grab its input parameters), like so:

diff --git a/includes/controllers/PortableInfoboxParserTagController.php b/includes/controllers/PortableInfoboxParserTagController.php
index dbf54b7..ec19dc7 100644
--- a/includes/controllers/PortableInfoboxParserTagController.php
+++ b/includes/controllers/PortableInfoboxParserTagController.php
@@ -121,6 +121,7 @@ class PortableInfoboxParserTagController {
         * @return string|array
         */
        public function renderInfobox( $text, $params, $parser, $frame ) {
+               var_dump(get_class($frame));
                $markup = '<' . self::PARSER_TAG_NAME . '>' . $text . '</' . self::PARSER_TAG_NAME . '>';
                $parserOutput = $parser->getOutput();

When I go to a page with an infobox using action=parsermigration-edit, I get:

string(20) "PPTemplateFrame_Hash"
string(12) "PPFrame_Hash"

So it seems like the legacy parser passes PPTemplateFrame_Hash to $frame, and Parsoid passes PPFrame_Hash to $frame. PPTemplateFrame_Hash::getArguments() gets... well, arguments (source), but interestingly, it appears that PPFrame_Hash::getArguments() is a stub (source).

BlankEclair commented 2 months ago

I give up debugging from here, this is way too deep into MediaWiki internals than I can handle.