Page MenuHomePhabricator

Fatal error: Cannot use object of type stdClass as array in FormatHtml.php on line 96
Closed, ResolvedPublic

Details

Related Gerrit Patches:
labs/tools/heritage : masterSafeguard against non-array $row
labs/tools/heritage : masterAdd project to dbPrimaryKey

Event Timeline

JeanFred created this task.Aug 20 2016, 2:51 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 20 2016, 2:51 PM
JeanFred moved this task from Backlog to API on the Wiki-Loves-Monuments board.Aug 20 2016, 2:54 PM
NickK awarded a token.Aug 20 2016, 3:13 PM
NickK added a subscriber: NickK.

Change 305794 had a related patch set uploaded (by Jean-Frédéric):
Safeguard against non-array $row

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

JeanFred added a comment.EditedAug 20 2016, 3:35 PM

So I’m a bit confused why this happens:

MariaDB [s51138__heritage_p]> SELECT id,lang,project FROM monuments_all WHERE id='46-101-0959';
+-------------+------+-----------+
| id          | lang | project   |
+-------------+------+-----------+
| 46-101-0959 | uk   | wikipedia |
+-------------+------+-----------+

Thoughts @Lokal_Profil ?

So this appears to have been caused by 96af0dcd.

Echo-ing my way around, turns out $row->project is undefined...

I remember that. It’s because project is not automatically requested >_<

I think I might have spotted it.

$res = $db->select( array_merge( Monuments::$dbPrimaryKey, $props ) is what ensures that lang is always included.

Change 306012 had a related patch set uploaded (by Lokal Profil):
Add project to dbPrimaryKey

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

Change 306012 merged by jenkins-bot:
Add project to dbPrimaryKey

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

Mentioned in SAL [2016-08-31T20:02:46Z] <JeanFred> Deployed latest from Git: 22496d6 (T143481), c964df5, 00ccf8a, 1891ee0, 4458eeb, 55fea41

JeanFred closed this task as Resolved.Aug 31 2016, 8:04 PM

This is now working! Thanks @Lokal_Profil :)

Change 305794 abandoned by Jean-Frédéric:
Safeguard against non-array $row

Reason:
This was correctly fixed by Lokal_Profil in 306012

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