Fatal error: Cannot use object of type stdClass as array in /data/project/heritage/heritage/api/includes/FormatHtml.php on line 96
Description
Description
Details
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Safeguard against non-array $row | labs/tools/heritage | master | +4 -1 | |
Add project to dbPrimaryKey | labs/tools/heritage | master | +1 -1 |
Related Objects
Related Objects
- Mentioned In
- T132644: API output is broken when orderby parameters are not requested was (API HTML output is broken when the municipality or address fields are not requested)
- Mentioned Here
- rTHERc964df5be31a: Localisation updates from https://translatewiki.net.
rTHER00ccf8aa81bd: Localisation updates from https://translatewiki.net.
rTHER1891ee0eed15: Localisation updates from https://translatewiki.net.
rTHER4458eeb2863b: Localisation updates from https://translatewiki.net.
rTHER22496d645c96: Add project to dbPrimaryKey
rTHER55fea415154e: Localisation updates from https://translatewiki.net.
rTHER96af0dcddbf6: Require row->project exists before fetching
Event Timeline
Comment Actions
Change 305794 had a related patch set uploaded (by Jean-Frédéric):
Safeguard against non-array $row
Comment Actions
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 ?
Comment Actions
So this appears to have been caused by 96af0dcd.
Echo-ing my way around, turns out $row->project is undefined...
Comment Actions
I think I might have spotted it.
$res = $db->select( array_merge( Monuments::$dbPrimaryKey, $props ) is what ensures that lang is always included.
Comment Actions
Change 306012 had a related patch set uploaded (by Lokal Profil):
Add project to dbPrimaryKey
Comment Actions
Change 305794 abandoned by Jean-Frédéric:
Safeguard against non-array $row
Reason:
This was correctly fixed by Lokal_Profil in 306012