From: Michael J. Rubinsky Date: Sat, 10 Apr 2010 17:41:57 +0000 (-0400) Subject: Need to push $app onto the stack before loading it's preferences. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=2b647b8ef7bb3be67b3b63616b9988de697744f6;p=horde.git Need to push $app onto the stack before loading it's preferences. Prevents fatal errors due to autoloading not being setup for the app. --- diff --git a/horde/lib/Api.php b/horde/lib/Api.php index 7e3ab5df6..0204a417c 100644 --- a/horde/lib/Api.php +++ b/horde/lib/Api.php @@ -155,8 +155,14 @@ class Horde_Api extends Horde_Registry_Api */ public function getPreference($app, $pref) { + $pushed = $GLOBALS['registry']->pushApp($app); $GLOBALS['registry']->loadPrefs($app); - return $GLOBALS['prefs']->getValue($pref); + $value = $GLOBALS['prefs']->getValue($pref); + if ($pushed) { + $GLOBALS['registry']->popApp(); + } + + return $value; } /** @@ -169,8 +175,12 @@ class Horde_Api extends Horde_Registry_Api */ public function setPreference($app, $pref, $value) { + $pushed = $GLOBALS['registry']->pushApp($app); $GLOBALS['registry']->loadPrefs($app); - return $GLOBALS['prefs']->setValue($pref, $value); + $value = $GLOBALS['prefs']->setValue($pref, $value); + if ($pushed) { + $GLOBALS['registry']->popApp(); + } } /**