Topic on Extension talk:WikiVideos

master breaks in MediaWiki 1.35.7, PHP 7.4.3

2
Summary by Sophivorus

Clone from git (instead of downloading from Extension Distributor) and don't forget to install the dependencies via composer.

Eafmbr (talkcontribs)

Hello ! The documentation says it requires PHP 7+ and MediaWiki 1.35+.

I installed the extension (master), got the API credentials and the system have the latest FFmpeg and FFprobe. Also, the instant commons is activated.

I tested with this code:

<gallery mode="video" width="300">
File:Old pond.jpg | Old pond
File:Frog leap.jpg | frog leaps in
File:Water sound.jpg | water's sound
</gallery>

And returned:

[d0d131784519ef4765c724ee] /index.php?title=Sandbox&action=submit ParseError from line 75 of /var/lib/mediawiki/extensions/WikiVideos/vendor/psr/cache/src/CacheItemInterface.php: syntax error, unexpected 'static' (T_STATIC)

Here is the Backtrace:

#0 /var/lib/mediawiki/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#2 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/auth/src/Cache/Item.php(33): spl_autoload_call()
#3 /var/lib/mediawiki/vendor/composer/ClassLoader.php(571): include(string)
#4 /var/lib/mediawiki/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#5 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#6 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/auth/src/Cache/MemoryCacheItemPool.php(62): spl_autoload_call()
#7 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/auth/src/Cache/MemoryCacheItemPool.php(45): Google\Auth\Cache\MemoryCacheItemPool->getItems()
#8 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/auth/src/CacheTrait.php(58): Google\Auth\Cache\MemoryCacheItemPool->getItem()
#9 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/auth/src/FetchAuthTokenCache.php(251): Google\Auth\FetchAuthTokenCache->getCachedValue()
#10 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/auth/src/FetchAuthTokenCache.php(208): Google\Auth\FetchAuthTokenCache->fetchAuthTokenFromCache()
#11 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/gax/src/CredentialsWrapper.php(212): Google\Auth\FetchAuthTokenCache->updateMetadata()
#12 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/gax/src/Transport/HttpUnaryTransportTrait.php(116): Google\ApiCore\CredentialsWrapper->Google\ApiCore\{closure}()
#13 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/gax/src/Transport/RestTransport.php(115): Google\ApiCore\Transport\RestTransport::buildCommonHeaders()
#14 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/gax/src/GapicClientTrait.php(760): Google\ApiCore\Transport\RestTransport->startUnaryCall()
#15 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php(61): Google\Cloud\TextToSpeech\V1\Gapic\TextToSpeechGapicClient->Google\ApiCore\{closure}()
#16 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php(69): Google\ApiCore\Middleware\CredentialsWrapperMiddleware->__invoke()
#17 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/gax/src/Middleware/RetryMiddleware.php(88): Google\ApiCore\Middleware\FixedHeaderMiddleware->__invoke()
#18 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/gax/src/Middleware/OptionsFilterMiddleware.php(63): Google\ApiCore\Middleware\RetryMiddleware->__invoke()
#19 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/gax/src/GapicClientTrait.php(735): Google\ApiCore\Middleware\OptionsFilterMiddleware->__invoke()
#20 /var/lib/mediawiki/extensions/WikiVideos/vendor/google/cloud-text-to-speech/src/V1/Gapic/TextToSpeechGapicClient.php(273): Google\Cloud\TextToSpeech\V1\Gapic\TextToSpeechGapicClient->startCall()
#21 /var/lib/mediawiki/extensions/WikiVideos/WikiVideosFactory.php(190): Google\Cloud\TextToSpeech\V1\Gapic\TextToSpeechGapicClient->synthesizeSpeech()
#22 /var/lib/mediawiki/extensions/WikiVideos/WikiVideosFactory.php(92): WikiVideosFactory::makeAudio()
#23 /var/lib/mediawiki/extensions/WikiVideos/WikiVideosFactory.php(43): WikiVideosFactory::makeScene()
#24 /var/lib/mediawiki/extensions/WikiVideos/WikiVideosGallery.php(47): WikiVideosFactory::makeVideo()
#25 /var/lib/mediawiki/includes/parser/Parser.php(5136): WikiVideosGallery->toHTML()
#26 /var/lib/mediawiki/includes/parser/CoreTagHooks.php(157): Parser->renderImageGallery()
#27 /var/lib/mediawiki/includes/parser/Parser.php(3922): CoreTagHooks::gallery()
#28 /var/lib/mediawiki/includes/parser/PPFrame_Hash.php(340): Parser->extensionSubstitution()
#29 /var/lib/mediawiki/includes/parser/Parser.php(2887): PPFrame_Hash->expand()
#30 /var/lib/mediawiki/includes/parser/Parser.php(1556): Parser->replaceVariables()
#31 /var/lib/mediawiki/includes/parser/Parser.php(651): Parser->internalParse()
#32 /var/lib/mediawiki/includes/content/WikitextContent.php(374): Parser->parse()
#33 /var/lib/mediawiki/includes/content/AbstractContent.php(590): WikitextContent->fillParserOutput()
#34 /var/lib/mediawiki/includes/EditPage.php(4286): AbstractContent->getParserOutput()
#35 /var/lib/mediawiki/includes/EditPage.php(4191): EditPage->doPreviewParse()
#36 /var/lib/mediawiki/includes/EditPage.php(2969): EditPage->getPreviewText()
#37 /var/lib/mediawiki/includes/EditPage.php(701): EditPage->showEditForm()
#38 /var/lib/mediawiki/includes/actions/EditAction.php(71): EditPage->edit()
#39 /var/lib/mediawiki/includes/actions/SubmitAction.php(38): EditAction->show()
#40 /var/lib/mediawiki/includes/MediaWiki.php(531): SubmitAction->show()
#41 /var/lib/mediawiki/includes/MediaWiki.php(313): MediaWiki->performAction()
#42 /var/lib/mediawiki/includes/MediaWiki.php(947): MediaWiki->performRequest()
#43 /var/lib/mediawiki/includes/MediaWiki.php(547): MediaWiki->main()
#44 /var/lib/mediawiki/index.php(53): MediaWiki->run()
#45 /var/lib/mediawiki/index.php(46): wfIndexMain()
#46 {main}

Looking up the "ParseError", people say its because the older php version.

Is there any workaroud?

Eafmbr (talkcontribs)

Cloned from git (instead of downloading from Extension Distritutor), installed the dependencies via composer and now it works like a charm.


Thank you, Mr. Sophovorus!