Topic on Extension talk:PDFEmbed

Use of "Parser::disableCache" was deprecated in MediaWiki 1.28.

6
Summary by Kghbln

A preliminary? working fork of the extension is mentioned in this thread.

Equalze (talkcontribs)

Any idea on how to remove this error across the top of the page? The pdf is embedding perfectly yet this error appears?

Use of Parser::disableCache was deprecated in MediaWiki 1.28. [Called from PDFEmbed::generateTag in xxxxxxxxxxxxxxxxxxxx  PDFEmbed\PDFEmbed.hooks.php at line 39] in xxxxxxxxxxxxxxxxx xxxxdebug\MWDebug.php

Any help appreciated

Kghbln (talkcontribs)

Probably you are not using the version of PDFEmbed matching the version of MediaWiki you are using, meaning that if you upgrade MediaWiki you also have to upgrade the extensions.

Probably you also have $wgShowExceptionDetails = true; somewhere in your "LocalSettings.php" file. You should change this to false if your wiki is live.

Equalze (talkcontribs)

@Kghbln Version has been updated to 2.0.2. the most up to date, MW Version is 1.34.0

Kghbln (talkcontribs)

Thanks for reporting back! So it appears that this issue is still part of the code base. I have created an issue report for the extension's developer.

Gracionsoft (talkcontribs)

MediaWiki 1.35 removed disableCache, so this is now a fatal exception. I've added this info and suggested code changes to the issue report that @Kghbin created.

VOIstri (talkcontribs)

So that others may find this, the error message was: "Error from line 39 of /var/www/html/w/extensions/PDFEmbed/PDFEmbed.hooks.php: Call to undefined method Parser::disableCache()". Path may, of course, be different.

In mediawiki version 1.34.4, the file includes/parser/Parser.php had a suggestion in the comments to the function disableCache() to "use getOutput()->updateCacheExpiry()". The function disableCache itself has the line "$this->mOutput->updateCacheExpiry( 0 ); // new style, for consistency" at the end.

I tried, therefore, changing the line "$parser->disableCache();" to "$parser->getOutput()->updateCacheExpiry(0);" in extensions/PDFEmbed/PDFEmbed.hooks.php. This seems to work, but I can't vouch for it's utility or safety.