PDFEmbed/PDFEmbed.hooks.php: Call to undefined method Parser::disableCache()
Topic on Extension talk:PDFEmbed
I created a (hopefully) working fix at https://github.com/WolfgangFahl/PDFEmbed and would love to share it we a pull request and get feeback on it. See also https://gitlab.com/hydrawiki/extensions/PDFEmbed/-/issues/19
Thanks for working on this and providing a way out.
Hi, @Seppl2013, thank you for the solution. In order to do some combability with the old synaxis, <pdf>File:Name-of-the-file.pdf</pdf>
, I've made an additional fix in my local copy of PDFEmbed.hooks.php
in this way:
127 $filename = $re[1];
128
129 if (count($re) == 3) {
130 $page = $re[2];
131 }
132 // the next lines are new
133 $ns_media_wiki_lang = MediaWiki\MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNsText( NS_MEDIA );
134 $ns_file_wiki_lang = MediaWiki\MediaWikiServices::getInstance()->getContentLanguage()->getFormattedNsText( NS_FILE );
135 $ns_media_lang_en = MediaWiki\MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' )->getFormattedNsText( NS_MEDIA );
136 $ns_file_lang_en = MediaWiki\MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' )->getFormattedNsText( NS_FILE );
137 $filename = preg_replace("/^($ns_media_wiki_lang|$ns_file_wiki_lang|$ns_media_lang_en|$ns_file_lang_en):/", '', $filename);
FYI, I received a "File does not exist error" using Seppl2013's clone and it worked again after introducing Spas.Z.Spasov's changes. Thanks to you both!
see https://github.com/WolfgangFahl/PDFEmbed/issues/3 for the fix