Skip to content
Snippets Groups Projects
Commit ec09718a authored by Jared Hancock's avatar Jared Hancock
Browse files

lists: Fix undef var adding new item

parent 84173987
No related branches found
No related tags found
No related merge requests found
......@@ -217,7 +217,7 @@ class DynamicFormsAjaxAPI extends AjaxController {
if ($_POST && ($valid = $item_form->isValid())) {
$data = $item_form->getClean();
if ($_item = DynamicListItem::lookup(array('value'=>$data['value'])))
if ($_item && $_item->id != $item->id)
if ($_item && $_item->id)
$item_form->getField('value')->addError(
__('Value already in use'));
$data['list_id'] = $list_id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment