From b16047bde2832aaf22dc18ac69829dd61a22fb75 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 9 Jul 2015 17:42:40 +0000 Subject: [PATCH] Fix custom field order renumbering to keep at multiples of 10, and handle cached custom fields --- phpgwapi/inc/class.egw_customfields.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.egw_customfields.inc.php b/phpgwapi/inc/class.egw_customfields.inc.php index 904ff3612a..1cb4e4831d 100755 --- a/phpgwapi/inc/class.egw_customfields.inc.php +++ b/phpgwapi/inc/class.egw_customfields.inc.php @@ -370,9 +370,10 @@ class egw_customfields implements IteratorAggregate if($cf['id']) { $cfs = egw_customfields::get($cf['app'], true); - $old = $cfs[$cf['id']]; - if($old['order'] != $cf['order']) + $old = $cfs[$cf['name']]; + if($old['order'] != $cf['order'] || $cf['order'] % 10 !== 0) { + $cfs[$cf['name']]['order'] = $cf['order']; uasort($cfs, function($a1, $a2){ return $a1['order'] - $a2['order']; });