Jump to content

Topic on Project:Support desk

OOUI error on search

3
Summary by Iowajason

IRC channel provided support as described in detail in prior post.

Iowajason (talkcontribs)

Recently upgraded a WAMP MediaWiki to 1.27.1. When using Search box, searches for terms that do NOT link to articles, that is, using the "Containing..." option where there is no article in the primary namespace that correspond to the search term entered, I get a PHP fatal error.

Fatal error: OOUI\InputWidget cannot use OOUI\FlaggedElement - it is not a trait in (wikiroot directory)\vendor\oojs\oojs-ui\php\widgets\InputWidget.php on line 11

Saw reference to a similar problem here Topic:Taia3uhd7ay5nxuk, but didn't see a solution or workaround. Any suggestions? Search box autocomplete working fine. Selecting a page from the search results dropdown works fine. Only issue I know of is the "containing..." search.

Software stack:

Windows 10 - Microsoft Windows [Version 10.0.14393]

MediaWiki 1.27.1
PHP 5.6.27 (apache2handler)
MySQL 5.6.30

Troubleshooting log:

1) Restarted Apache web server

2) Checked Apache error.log file, but no errors there.

3) Ran "composer update" on main MediaWiki composer file and restarted Apache again.

Several (10-12) warnings were issued about specific class files, like:

Warning: Ambiguous class resolution, "OOUI\ButtonElement" was found in both "C:\Users\Public\Documents\website\RTWWiki\vendor/oojs/oojs-ui/php/elements\ButtonElement.php" and "C:\Users\Public\Documents\website\RTWWiki\vendor/oojs/oojs-ui/php/mixins\ButtonElement.php", the first will be used.

4) Re-ran maintenance/update script. I had to correct some permission errors on the account the wiki was using to allow it DROP table permissions. Update script could then run these two commands, which it previously erred on:

Dropping table msg_resource_links ...done.

Dropping table msg_resource ...done.

! ) Fatal error: OOUI\InputWidget cannot use OOUI\FlaggedElement - it is not a trait in C:\Users\Public\Documents\website\RTWWiki\vendor\oojs\oojs-ui\php\widgets\InputWidget.php on line 11
Call Stack
# Time Memory Function Location
1 0.0014 242328 {main}( ) ...\index.php:0
2 0.5346 16699416 MediaWiki->run( ) ...\index.php:43
3 0.5346 16700616 MediaWiki->main( ) ...\MediaWiki.php:519
4 0.5419 17216392 MediaWiki->performRequest( ) ...\MediaWiki.php:745
5 0.5442 17582240 SpecialPageFactory::executePath( ) ...\MediaWiki.php:282
6 0.5444 17585216 SpecialPage->run( ) ...\SpecialPageFactory.php:576
7 0.5444 17585616 SpecialSearch->execute( ) ...\SpecialPage.php:479
8 0.7767 23665760 SpecialSearch->showResults( ) ...\SpecialSearch.php:140
9 0.8404 24864816 SpecialSearch->shortDialog( ) ...\SpecialSearch.php:342
10 0.8404 24865120 spl_autoload_call ( ) ...\SpecialSearch.php:1236
11 0.8404 24865344 AutoLoader::autoload( ) ...\SpecialSearch.php:1236
12 0.8409 24879168 require( 'C:\Users\Public\Documents\website\RTWWiki\includes\widget\SearchInputWidget.php' ) ...\AutoLoader.php:81
13 0.8409 24879496 spl_autoload_call ( ) ...\AutoLoader.php:13
14 0.8410 24879728 AutoLoader::autoload( ) ...\AutoLoader.php:13
15 0.8414 24897640 require( 'C:\Users\Public\Documents\website\RTWWiki\includes\widget\TitleInputWidget.php' ) ...\AutoLoader.php:81
16 0.8414 24897912 spl_autoload_call ( ) ...\AutoLoader.php:13
17 0.8415 24898104 Composer\Autoload\ClassLoader->loadClass( ) ...\AutoLoader.php:13
18 0.8415 24898104 Composer\Autoload\includeFile( ) ...\ClassLoader.php:301
19 0.8424 24951832 include( 'C:\Users\Public\Documents\website\RTWWiki\vendor\oojs\oojs-ui\php\widgets\TextInputWidget.php' ) ...\ClassLoader.php:414
20 0.8424 24952120 spl_autoload_call ( ) ...\ClassLoader.php:8
21 0.8425 24952312 Composer\Autoload\ClassLoader->loadClass( ) ...\ClassLoader.php:8
22 0.8425 24952312 Composer\Autoload\includeFile( ) ...\ClassLoader.php:301
23 0.8435 24988232 include( 'C:\Users\Public\Documents\website\RTWWiki\vendor\oojs\oojs-ui\php\widgets\InputWidget.php' ) ...\ClassLoader.php:414

Appreciate any help.

Thanks,

IowaJason

Iowajason (talkcontribs)

bawolff on IRC support channel provided a solution. Basic problem is that my upgrade technique was to overlay new version of MW software over old version directory structure, creating duplicate paths. The suggestions was to install into clean directory on file system.

The shortcut I used accomplished to accomplish this goal was:

1) Stop Apache web server

2) Delete "includes" and "vendor" directories (I hypothesize that only "vendor" directory would have been sufficient.)

3) Recopy those 2 directories from distribution tarball.

4) Run "composer update" although I'm advised that such step is unnecessary.

5) Restart Apache

Thank you to bawolff.

Aploe (talkcontribs)

Hi there,

I'm not sure if anyone still needs the solution. But I think this error can occur anytime you upgrade an old wiki via composer.

The ambiguous class declaration comes from the files inside the /vendor/oojs/oojs-ui/php/elements folder. It's outdated and seems to not get deleted by the composer while updating. Just delete this folder and rerun the composer update.

This should do it.

Regards,

aploe

Reply to "OOUI error on search"