From 609e909eef2d0dc60f11ffaed40452f29a89e847 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 30 Jun 2014 08:59:19 +0000 Subject: [PATCH] Make sure the content[owner] is an array because lisbox widget expects to receive an array --- admin/inc/class.admin_categories.inc.php | 3 ++- admin/js/app.js | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/inc/class.admin_categories.inc.php b/admin/inc/class.admin_categories.inc.php index d6a7580b6e..1209ceaaeb 100644 --- a/admin/inc/class.admin_categories.inc.php +++ b/admin/inc/class.admin_categories.inc.php @@ -268,7 +268,8 @@ class admin_categories $readonlys['button[delete]'] = !$content['id'] || !self::$acl_delete || // cant delete not yet saved category $appname != $content['appname'] || // Can't edit a category from a different app ($this->appname != 'admin' && $content['owner'] != $GLOBALS['egw_info']['user']['account_id']); - + // Make sure $content['owner'] is an array otherwise it wont show up values in the multiselectbox + if (!is_array($content['owner'])) $content['owner'] = explode(',',$content['owner']); $tmpl = new etemplate_new('admin.categories.edit'); $tmpl->exec($this->edit_link,$content,$sel_options,$readonlys,$content+array( 'old_parent' => $content['old_parent'] ? $content['old_parent'] : $content['parent'], 'appname' => $appname diff --git a/admin/js/app.js b/admin/js/app.js index 97ae0cbe17..4d5c884f38 100644 --- a/admin/js/app.js +++ b/admin/js/app.js @@ -626,10 +626,9 @@ app.classes.admin = AppJS.extend( } // Find out what changed - var content = this.et2.getArrayMgr('content').getEntry('owner'); - if (content) + var cat_original_owner = this.et2.getArrayMgr('content').getEntry('owner'); + if (cat_original_owner) { - var cat_original_owner = content.split(","); var selected_groups = select_owner.get_value().toString(); for(var i =0;i < cat_original_owner.length;i++)