From: <gem...@li...> - 2012-01-05 11:47:27
|
Revision: 397 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=397&view=rev Author: mennodekker Date: 2012-01-05 11:47:16 +0000 (Thu, 05 Jan 2012) Log Message: ----------- Fixed error for the case that no registry key for MUtil_Model_FormBridge options is present and made the key configurable Modified Paths: -------------- trunk/library/classes/GemsEscort.php trunk/library/classes/MUtil/Model/FormBridge.php Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2012-01-05 09:54:04 UTC (rev 396) +++ trunk/library/classes/GemsEscort.php 2012-01-05 11:47:16 UTC (rev 397) @@ -1011,7 +1011,7 @@ 'showOn' => 'button', ); - Zend_Registry::set('MUtil_Model_FormBridge', array('date' => $dateFormOptions)); + Zend_Registry::set(MUtil_Model_FormBridge::REGISTRY_KEY, array('date' => $dateFormOptions)); } protected function createProjectClass($className, $param1 = null, $param2 = null) Modified: trunk/library/classes/MUtil/Model/FormBridge.php =================================================================== --- trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-05 09:54:04 UTC (rev 396) +++ trunk/library/classes/MUtil/Model/FormBridge.php 2012-01-05 11:47:16 UTC (rev 397) @@ -64,6 +64,11 @@ const TEXT_OPTIONS = 'text'; const TEXTAREA_OPTIONS = 'textarea'; + /** + * The key to use in the Zend_Registry to store global fixed options + */ + const REGISTRY_KEY = 'MUtil_Model_FormBridge'; + protected $form; protected $model; @@ -670,7 +675,11 @@ static $typeOptions; if (! $typeOptions) { - $typeOptions = Zend_Registry::get('MUtil_Model_FormBridge'); + if (Zend_Registry::isRegistered(self::REGISTRY_KEY)) { + $typeOptions = Zend_Registry::get(self::REGISTRY_KEY); + } else { + $typeOptions = array(); + } } if (substr($type, 0, 3) == 'add') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |