Page MenuHomePhabricator

SMW: Warning: array_merge(): Argument #2 is not an array
Closed, ResolvedPublic

Description

Author: van.de.bugger

Description:
Recently I updated SMW to v1.7.0.2. With new SMW browsing "Property:Title" page ("Title" is a user-defined property) causes the PHP warning:

Warning: array_merge(): Argument #2 is not an array in /var/www/oc.su/MediaWiki-1.18/includes/Sanitizer.php on line 714

When I roll back to SMW r105224, warning disappears, and property page is displayed cleanly.

I temporary added a "if" check:

static function mergeAttributes( $a, $b ) {

$out = array_merge( $a, $b );
if ( ! is_array( $b ) ) {
    throw new Exception( "AAAAAAAAAAAAAAA" );
};

and get a callstack:

Unexpected non-MediaWiki exception encountered, of type "Exception"

exception 'Exception' with message 'AAAAAAAAAAAAAAA' in /var/www/oc.su/MediaWiki-1.18/includes/Sanitizer.php:716

Stack trace:
#0 /var/www/oc.su/MediaWiki-1.18/includes/Linker.php(313): Sanitizer::mergeAttributes(Array, 'x=Title%2F-26-2...')
#1 /var/www/oc.su/MediaWiki-1.18/includes/Linker.php(209): Linker::linkAttribs(Object(Title), 'x=Title%2F-26-2...', Array)
#2 [internal function]: Linker::link(Object(Title), '+', 'x=Title%2F-26-2...')
#3 /var/www/oc.su/MediaWiki-1.18/includes/Linker.php(2003): call_user_func_array(Array, Array)
#4 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.0.2/includes/SMW_Infolink.php(251): DummyLinker->__call('link', Array)
#5 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.0.2/includes/SMW_Infolink.php(251): DummyLinker->link(Object(Title), '+', 'x=Title%2F-26-2...')
#6 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.0.2/includes/SMW_Infolink.php(276): SMWInfolink->getText(1, Object(DummyLinker))
#7 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.0.2/includes/datavalues/SMW_DataValue.php(572): SMWInfolink->getHTML(Object(DummyLinker))
#8 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.0.2/includes/articlepages/SMW_PropertyPage.php(177): SMWDataValue->getInfolinkText(1, Object(DummyLinker))
#9 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.0.2/includes/articlepages/SMW_PropertyPage.php(113): SMWPropertyPage->subjectObjectList(Array)
#10 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.0.2/includes/articlepages/SMW_PropertyPage.php(34): SMWPropertyPage->getPropertyValueList()
#11 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.0.2/includes/articlepages/SMW_OrderedListPage.php(83): SMWPropertyPage->getHtml()

#12 /var/www/oc.su/Extensions/SemanticMediaWiki-1.7.0.2/includes/articlepages/SMW_OrderedListPage.php(67): SMWOrderedListPage->showList()

#13 /var/www/oc.su/MediaWiki-1.18/includes/Wiki.php(479): SMWOrderedListPage->view()
#14 /var/www/oc.su/MediaWiki-1.18/includes/Wiki.php(250): MediaWiki->performAction(Object(SMWPropertyPage))
#15 /var/www/oc.su/MediaWiki-1.18/includes/Wiki.php(635): MediaWiki->performRequest()
#16 /var/www/oc.su/MediaWiki-1.18/includes/Wiki.php(542): MediaWiki->main()
#17 /var/www/oc.su/MediaWiki-1.18/index.php(57): MediaWiki->run()
#18 {main}

It should help to diagnose the cause of issue.


Version: unspecified
Severity: normal

Details

Reference
bz34306

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:18 AM
bzimport set Reference to bz34306.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Feb 9 2012, 9:08 PM

Should be fixed by r111124. Can you confirm?

Thanks for the report - and that stack trace was very helpful :)

van.de.bugger wrote:

Verified on r111141.