Page MenuHomePhabricator

"Cannot use object of type Comment as array"
Open, Needs TriagePublic

Description

Everytime I save a new blog article I get this fatal error: "PHP Fatal error: Cannot use object of type Comment as array in /usr/local/mediawiki/testwiki/extensions/BlogPage/BlogPageClass.php on line 931"
The article seems to be saved anyway, but when I try to click on it I get the same error.

Event Timeline

Restricted Application added a project: Social-Tools. · View Herald TranscriptAug 25 2017, 8:17 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Tgr added a subscriber: Tgr.Aug 29 2017, 5:18 PM

Seems like the rewrite in rEBLOa5477d7cc522: Finally make the "comments of the day" feature work again that replaced ad-hoc SQL queries with depending on the Comments extension resulted in $comments being an array of Comment object instead of an array of arrays, but the display code was not updated to handle that.

I think this has been fixed somehow (or maybe because the feature that caused the error has been disabled in rEBLO08eb64a9a), because in my tests I haven't encountered this problem yet.

ashley added a subscriber: ashley.Aug 23 2018, 10:56 PM

I think this has been fixed somehow (or maybe because the feature that caused the error has been disabled in rEBLO08eb64a9a), because in my tests I haven't encountered this problem yet.

Comments of the Day feature was removed from Comments in Change-Id: I57601a3c321c6c8233a832260ab7fa063f4ae14f (14 June 2018). I'd eventually like to bring it back and fix this bug properly, but given this bug as well as LinkFilter's (still broken?) usage of the CotD stuff, that's easier said than done.

If you're interested in bringing CotD back and giving a try at fixing this bug, feel free to -- I'd love to see what you can come up with! :-) But if not, no worries, we can just leave this bug open for a rainy day.