From 4c09c1dc477ef920aa408a99c88deac4e43df6e8 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 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; -- 2.39.5