From: Brion Vibber Date: Wed, 2 Mar 2011 01:01:35 +0000 (-0800) Subject: Workaround for bug causing fatal error during favoriting; Profile::getCurrentNotice... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4c09c1dc477ef920aa408a99c88deac4e43df6e8;p=quix0rs-gnu-social.git Workaround for bug causing fatal error during favoriting; Profile::getCurrentNotice() was returning an ArrayList instead of a Notice directly due to pulling through Profile::getNotices(). This caused failure in Fave::addNew() which specifies it wants a Notice. Caused failure of the 'fav' IM command. --- diff --git a/classes/Profile.php b/classes/Profile.php index fd41c6139a..d030e38b1b 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -186,6 +186,10 @@ class Profile extends Memcached_DataObject $notice = $this->getNotices(0, 1); if ($notice->fetch()) { + if ($notice instanceof ArrayWrapper) { + // hack for things trying to work with single notices + return $notice->_items[0]; + } return $notice; } else { return null;