From: <gem...@li...> - 2013-03-12 20:13:13
|
Revision: 1174 http://sourceforge.net/p/gemstracker/code/1174 Author: matijsdejong Date: 2013-03-12 20:13:10 +0000 (Tue, 12 Mar 2013) Log Message: ----------- New getItemsOrdered caused breaks Modified Paths: -------------- trunk/library/classes/MUtil/Model/ModelAbstract.php Modified: trunk/library/classes/MUtil/Model/ModelAbstract.php =================================================================== --- trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-12 19:59:39 UTC (rev 1173) +++ trunk/library/classes/MUtil/Model/ModelAbstract.php 2013-03-12 20:13:10 UTC (rev 1174) @@ -712,9 +712,19 @@ */ public function getItemsOrdered() { - asort($this->_model_order); - $order = array_keys($this->_model_order); - return $order + array_diff(array_keys($this->_model), $order); + $order = (array) $this->_model_order; + asort($order); + $result = array_keys($order); + foreach($this->_model as $field => $element) { + if (! array_key_exists($field, $order)) { + $result[] = $field; + } + } + return $result; + + // asort($this->_model_order); + // $order = array_keys($this->_model_order); + // return $order + array_diff(array_keys($this->_model), $order); } public function getItemsUsed() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |