Last modified: 2013-10-23 17:21:54 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57826, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55826 - PHP Fatal error: Only variables can be passed by reference in includes/api/ApiBrowse.php
PHP Fatal error: Only variables can be passed by reference in includes/api/Ap...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Semantic MediaWiki (Other open bugs)
master
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 39480
  Show dependency treegraph
 
Reported: 2013-10-17 07:34 UTC by Nemo
Modified: 2013-10-23 17:21 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Nemo 2013-10-17 07:34:43 UTC
09.15 -rakkaus:#mediawiki-i18n- [17-Oct-2013 07:15:15 UTC] PHP Fatal error:  Only variables can be passed by reference in /www/translatewiki.net/w/extensions/SemanticMediaWiki/includes/api/ApiBrowse.php on line 122
Comment 1 MWJames 2013-10-17 13:07:34 UTC
This is strange, neither Jenkins nor Travis kicked in since this part is covered [1]. Do you have the full stack trace?

[1] https://coveralls.io/files/68365996
Comment 2 Niklas Laxström 2013-10-17 13:20:11 UTC
I don't. And I do not know how to reliable reproduce this, so it is difficult to get one.
Comment 3 MWJames 2013-10-17 13:27:16 UTC
I try using [1].

[1] https://translatewiki.net/w/api.php?action=browse&subject=Main_Page
Comment 4 MWJames 2013-10-17 13:28:56 UTC
(In reply to comment #3)
> I try using [1].
> 
> [1] https://translatewiki.net/w/api.php?action=browse&subject=Main_Page

I'm already asleep. Of course, I meant "I tried".
Comment 5 MWJames 2013-10-17 13:31:37 UTC
While fixing the issue shouldn't be the issue here, I'm more interested into why the unit tests didn't raise a flag on both CI's (Jenkins and Travis).
Comment 6 Nemo 2013-10-17 13:33:35 UTC
(In reply to comment #3)
> I tr[ied] using [1].
> 
> [1] https://translatewiki.net/w/api.php?action=browse&subject=Main_Page

Yes, that produces it. :)
Comment 7 Niklas Laxström 2013-10-17 13:37:42 UTC
Not sure if this helps (missing params) but pasting anyway:

[17-Oct-2013 13:36:01 UTC] <ul>
<li>ApiBrowse.php line 122 calls wfBacktrace()</li>
<li>ApiBrowse.php line 97 calls SMW\ApiBrowse->addIndexTags()</li>
<li>ApiBrowse.php line 28 calls SMW\ApiBrowse->runFormatter()</li>
<li>ApiMain.php line 834 calls SMW\ApiBrowse->execute()</li>
<li>ApiMain.php line 380 calls ApiMain->executeAction()</li>
<li>ApiMain.php line 351 calls ApiMain->executeActionWithErrorHandling()</li>
<li>api.php line 73 calls ApiMain->execute()</li>
</ul>
Comment 8 MWJames 2013-10-17 13:55:37 UTC
The following [1] should do the trick but I'd like to have the tests failing first before making any attempt on fixing this.

$tag =& $serialized['data'][ $key ]['dataitem'];
$this->getResult()->setIndexedTagName( $tag, 'value' );
Comment 9 MWJames 2013-10-17 18:08:34 UTC
After looking into it, two issue came into play as to way the unit tests didn't catch the issue.

The first issue was caused by PHP 5.3 (I used and old 5.3.8 to verify the issue) which handles pass-by-reference for empty arrays differently and secondly $this->getResult()->setIndexedTagName() (responsible to add '_element' for XML output) applies internally a check whether getIsRawMode() is true/false which in case of the current unit test returns false and therefore will not engage in any array manipulation.

By setting $this->getResult()->setRawMode() in the unit test the error is caught which means I'll have to adjust the unit test in order to incorporate the setRawMode() option before fixing the issue which is doing an additional is_array() check.
Comment 10 Gerrit Notification Bot 2013-10-17 18:59:20 UTC
Change 90389 had a related patch set uploaded by Mwjames:
(#bug 55826) Force ApiBrowse unit test to fail

https://gerrit.wikimedia.org/r/90389
Comment 11 Gerrit Notification Bot 2013-10-17 19:15:18 UTC
Change 90389 merged by jenkins-bot:
(Bug 55826) Fix ApiBrowse unit test failure

https://gerrit.wikimedia.org/r/90389

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links