ProfessionalWiki / ExternalContent

MediaWiki extension that allows embedding external content
https://professional.wiki/en/news/external-content
GNU General Public License v2.0
7 stars 4 forks source link

Add compatibility for MediaWiki 1.39 #27

Closed daBard closed 1 year ago

daBard commented 1 year ago

We recently updated MW to the current long-term support version (1.39.x) and that broke the extension.

Error [35d02d31786254701aa23388] 2023-05-17 06:24:49: Allvarligt fel av typen "Error"

The Swedish part says 'Serious error of type "Error"'

Versions MediaWiki --- 1.39.3 PHP --- 7.4.3-4ubuntu2.18 (apache2handler) ExternalContent --- 1.3.0

kghbln commented 1 year ago

Thanks for reporting. It would be great if you could provide a "stack trace". See also How to debug. Add to "LocalSettings.php":

error_reporting( -1 );
ini_set( 'display_errors', 1 );
$wgShowExceptionDetails = true;
daBard commented 1 year ago

It took a while since server juggling is in another department. Here's the backtrace, in all it's glory:

[526fa720127c3a95b6fd6a20] /index.php/Mall:ExtContent Error: Interface 'FileFetcher\FileFetcher' not found

Backtrace:

from /var/www/html/extensions/ExternalContent/src/Adapters/FileFetcher/MediaWikiFileFetcher.php(11)
#0 /var/www/html/includes/AutoLoader.php(244): require()
#1 [internal function]: AutoLoader::autoload()
#2 /var/www/html/extensions/ExternalContent/src/EmbedExtensionFactory.php(95): spl_autoload_call()
#3 /var/www/html/extensions/ExternalContent/src/EmbedExtensionFactory.php(57): ProfessionalWiki\ExternalContent\EmbedExtensionFactory->getFileFetcher()
#4 /var/www/html/extensions/ExternalContent/src/EntryPoints/EmbedFunction.php(25): ProfessionalWiki\ExternalContent\EmbedExtensionFactory->newEmbedUseCaseForEmbedFunction()
#5 /var/www/html/extensions/ExternalContent/src/EntryPoints/MediaWikiHooks.php(22): ProfessionalWiki\ExternalContent\EntryPoints\EmbedFunction->handleParserFunctionCall()
#6 /var/www/html/includes/parser/Parser.php(3443): ProfessionalWiki\ExternalContent\EntryPoints\MediaWikiHooks::ProfessionalWiki\ExternalContent\EntryPoints\{closure}()
#7 /var/www/html/includes/parser/Parser.php(3126): Parser->callParserFunction()
#8 /var/www/html/includes/parser/PPFrame_Hash.php(276): Parser->braceSubstitution()
#9 /var/www/html/includes/parser/Parser.php(2955): PPFrame_Hash->expand()
#10 /var/www/html/includes/parser/Parser.php(1610): Parser->replaceVariables()
#11 /var/www/html/includes/parser/Parser.php(724): Parser->internalParse()
#12 /var/www/html/includes/content/WikitextContentHandler.php(301): Parser->parse()
#13 /var/www/html/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()
#14 /var/www/html/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()
#15 /var/www/html/includes/Revision/RenderedRevision.php(266): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()
#16 /var/www/html/includes/Revision/RenderedRevision.php(237): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()
#17 /var/www/html/includes/Revision/RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()
#18 /var/www/html/includes/Revision/RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()
#19 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()
#20 /var/www/html/includes/Revision/RenderedRevision.php(199): call_user_func()
#21 /var/www/html/includes/poolcounter/PoolWorkArticleView.php(91): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#22 /var/www/html/includes/poolcounter/PoolWorkArticleViewCurrent.php(97): PoolWorkArticleView->renderRevision()
#23 /var/www/html/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleViewCurrent->doWork()
#24 /var/www/html/includes/page/ParserOutputAccess.php(299): PoolCounterWork->execute()
#25 /var/www/html/includes/page/Article.php(714): MediaWiki\Page\ParserOutputAccess->getParserOutput()
#26 /var/www/html/includes/page/Article.php(528): Article->generateContentOutput()
#27 /var/www/html/includes/actions/ViewAction.php(78): Article->view()
#28 /var/www/html/includes/MediaWiki.php(542): ViewAction->show()
#29 /var/www/html/includes/MediaWiki.php(322): MediaWiki->performAction()
#30 /var/www/html/includes/MediaWiki.php(904): MediaWiki->performRequest()
#31 /var/www/html/includes/MediaWiki.php(562): MediaWiki->main()
#32 /var/www/html/index.php(50): MediaWiki->run()
#33 /var/www/html/index.php(46): wfIndexMain()
#34 {main}
JeroenDeDauw commented 1 year ago

That suggests the extension is not installed correctly, rather than a compatibility issue. Possibly you broke the installation during upgrade to new MW version. Run composer install to fix. Make sure the extension is in composer.local.json

daBard commented 1 year ago

Server tech tried to reinstall using the suggested commands. It resulted in the following error:

drift@tkfwiki01:/var/www/html$ composer update professional-wiki/external-content --no-dev -o
> ComposerHookHandler::onPreUpdate
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
    - Root composer.json requires composer/semver 3.3.2, found composer/semver[3.3.2] but the package is fixed to 3.2.6 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 2
    - Root composer.json requires cssjanus/cssjanus 2.1.1, found cssjanus/cssjanus[v2.1.1] but the package is fixed to v2.1.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 3
    - Root composer.json requires oojs/oojs-ui 0.44.5, found oojs/oojs-ui[v0.44.5] but the package is fixed to v0.43.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 4
    - Root composer.json requires pear/mail 1.5.0, found pear/mail[v1.5.0] but the package is fixed to v1.4.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 5
    - Root composer.json requires symfony/polyfill-php80 1.26.0, found symfony/polyfill-php80[v1.26.0] but the package is fixed to v1.25.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 6
    - Root composer.json requires symfony/yaml 5.4.10, found symfony/yaml[v5.4.10] but the package is fixed to v5.4.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 7
    - Root composer.json requires wikimedia/base-convert 2.0.2, found wikimedia/base-convert[v2.0.2] but the package is fixed to v2.0.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 8
    - Root composer.json requires wikimedia/ip-set 3.1.0, found wikimedia/ip-set[3.1.0] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 9
    - Root composer.json requires wikimedia/minify 2.3.0, found wikimedia/minify[2.3.0] but the package is fixed to 2.2.6 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 10
    - Root composer.json requires wikimedia/parsoid 0.16.1, found wikimedia/parsoid[v0.16.1] but the package is fixed to v0.15.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 11
    - Root composer.json requires wikimedia/php-session-serializer 2.0.1, found wikimedia/php-session-serializer[v2.0.1] but the package is fixed to v2.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 12
    - Root composer.json requires wikimedia/remex-html 3.0.3, found wikimedia/remex-html[3.0.3] but the package is fixed to 3.0.2 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 13
    - Root composer.json requires wikimedia/running-stat 2.1.0, found wikimedia/running-stat[v2.1.0] but the package is fixed to v1.2.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 14
    - Root composer.json requires wikimedia/scoped-callback 4.0.0, found wikimedia/scoped-callback[v4.0.0] but the package is fixed to v3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 15
    - Root composer.json requires wikimedia/services 3.0.0, found wikimedia/services[3.0.0] but the package is fixed to 2.0.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 16
    - Root composer.json requires wikimedia/timestamp 4.0.0, found wikimedia/timestamp[v4.0.0] but the package is fixed to v3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 17
    - Root composer.json requires wikimedia/xmp-reader 0.8.6, found wikimedia/xmp-reader[0.8.6] but the package is fixed to 0.8.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 18
    - Root composer.json requires composer/spdx-licenses 1.5.7, found composer/spdx-licenses[1.5.7] but the package is fixed to 1.5.5 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 19
    - Root composer.json requires doctrine/dbal 3.4.2, found doctrine/dbal[3.4.2] but the package is fixed to 3.1.5 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 20
    - Root composer.json requires mediawiki/mediawiki-phan-config 0.11.1, found mediawiki/mediawiki-phan-config[0.11.1] but the package is fixed to 0.11.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 21
    - Root composer.json requires phpunit/phpunit 8.5.28, found phpunit/phpunit[8.5.28] but the package is fixed to 8.5.33 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.
JeroenDeDauw commented 1 year ago

I confirmed the extension works with MW 39