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=d09aa9c94728a3e4369dfb7b171b7e52e59b1234;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 2ad302ccb8..88edf5cbb3 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;