From 4b5fd66a75fa9421cdd4f8b15ab6c439a78b67b8 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 20 Jul 2015 19:57:27 -0500 Subject: [PATCH] list: Fix ui update when list properties are deleted --- scp/js/jquery.translatable.js | 2 +- scp/lists.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scp/js/jquery.translatable.js b/scp/js/jquery.translatable.js index 64331b166..41b28a169 100644 --- a/scp/js/jquery.translatable.js +++ b/scp/js/jquery.translatable.js @@ -223,7 +223,7 @@ $.fn.translatable.defaults = { menu: '<div class="translations"></div>', - button: '<button class="translatable"><i class="fa fa-globe icon-globe"></i></button>' + button: '<button type="button" class="translatable"><i class="fa fa-globe icon-globe"></i></button>' }; $.fn.translatable.Constructor = Translatable; diff --git a/scp/lists.php b/scp/lists.php index 35fcef37d..57509ce0a 100644 --- a/scp/lists.php +++ b/scp/lists.php @@ -44,10 +44,11 @@ if($_POST) { // Update properties if (!$errors && ($form = $list->getForm())) { $names = array(); - foreach ($form->getDynamicFields() as $field) { + $fields = $form->getDynamicFields(); + foreach ($fields as $field) { $id = $field->get('id'); if ($_POST["delete-prop-$id"] == 'on' && $field->isDeletable()) { - $field->delete(); + $fields->remove($field); // Don't bother updating the field continue; } -- GitLab