Jump to content

Topic on Manual talk:Installation requirements

PageTranslationHooks.php: [] operator not supported for strings ?

2
80.1.154.95 (talkcontribs)

I updated my php to 7.1.3 on Archlinux, then mediawiki to 1.28 and MLEB 2017.01.

But when I'm logged in and go to a translated page, I've got the following error.

I'm assuming it's related to php 7.1 but I can't roll back as it's part of a stack.

Any one have an idea to fix this issue?

[928678b78dfffb063994597a] /documentation/index.php?title=DSBrowser_versions/en Error from line 629 of /usr/share/webapps/mediawiki/extensions/Translate/tag/PageTranslationHooks.php: [] operator not supported for strings

Backtrace:

#0 /usr/share/webapps/mediawiki/includes/Hooks.php(195): PageTranslationHooks::preventPatrolling(Title, User, string, string)

#1 /usr/share/webapps/mediawiki/includes/Title.php(2060): Hooks::run(string, array)

#2 /usr/share/webapps/mediawiki/includes/Title.php(2498): Title->checkPermissionHooks(string, User, array, string, boolean)

#3 /usr/share/webapps/mediawiki/includes/Title.php(1903): Title->getUserPermissionsErrorsInternal(string, User, string, boolean)

#4 /usr/share/webapps/mediawiki/includes/Title.php(1885): Title->userCan(string, User, boolean)

#5 /usr/share/webapps/mediawiki/includes/page/Article.php(1060): Title->quickUserCan(string, User)

#6 /usr/share/webapps/mediawiki/includes/page/Article.php(1038): Article->showPatrolFooter()

#7 /usr/share/webapps/mediawiki/includes/page/Article.php(718): Article->showViewFooter()

#8 /usr/share/webapps/mediawiki/includes/actions/ViewAction.php(71): Article->view()

#9 /usr/share/webapps/mediawiki/includes/MediaWiki.php(495): ViewAction->show()

#10 /usr/share/webapps/mediawiki/includes/MediaWiki.php(289): MediaWiki->performAction(Article, Title)

#11 /usr/share/webapps/mediawiki/includes/MediaWiki.php(851): MediaWiki->performRequest()

#12 /usr/share/webapps/mediawiki/includes/MediaWiki.php(512): MediaWiki->main()

#13 /usr/share/webapps/mediawiki/index.php(43): MediaWiki->run()

#14 {main}

130.245.68.36 (talkcontribs)

I just tried to manually change $result[] = ... to

$result = array();

$result[] = ...

Seems to work, not sure if there's any other place need to change

Reply to "PageTranslationHooks.php: [] operator not supported for strings ?"