Page MenuHomePhabricator

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



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/ 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/

Stack trace:
#0 /var/www/ Sanitizer::mergeAttributes(Array, 'x=Title%2F-26-2...')
#1 /var/www/ 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/ call_user_func_array(Array, Array)
#4 /var/www/ DummyLinker->__call('link', Array)
#5 /var/www/ DummyLinker->link(Object(Title), '+', 'x=Title%2F-26-2...')
#6 /var/www/ SMWInfolink->getText(1, Object(DummyLinker))
#7 /var/www/ SMWInfolink->getHTML(Object(DummyLinker))
#8 /var/www/ SMWDataValue->getInfolinkText(1, Object(DummyLinker))
#9 /var/www/ SMWPropertyPage->subjectObjectList(Array)
#10 /var/www/ SMWPropertyPage->getPropertyValueList()
#11 /var/www/ SMWPropertyPage->getHtml()

#12 /var/www/ SMWOrderedListPage->showList()

#13 /var/www/ SMWOrderedListPage->view()
#14 /var/www/ MediaWiki->performAction(Object(SMWPropertyPage))
#15 /var/www/ MediaWiki->performRequest()
#16 /var/www/ MediaWiki->main()
#17 /var/www/ MediaWiki->run()
#18 {main}

It should help to diagnose the cause of issue.

Version: unspecified
Severity: normal



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).

Should be fixed by r111124. Can you confirm?

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

Verified on r111141.