From d09aa9c94728a3e4369dfb7b171b7e52e59b1234 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 1 Mar 2011 17:01:35 -0800 Subject: [PATCH] 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. --- classes/Profile.php | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.39.5