From ae8c2c14e07ff9080c3222c375fa552a20e039a2 Mon Sep 17 00:00:00 2001 From: CommanderRoot Date: Sat, 25 Jan 2020 00:59:01 +0100 Subject: [PATCH] Fix broken remove logic Got broken in commit: b93ae50 Signed-off-by: Tobias Speicher --- js/table/relation.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/table/relation.js b/js/table/relation.js index ac4cb48c00..cdfdf64ee5 100644 --- a/js/table/relation.js +++ b/js/table/relation.js @@ -190,8 +190,12 @@ AJAX.registerOnload('table/relation.js', function () { $newRow.find('a.add_foreign_key_field').attr('data-index', newIndex); // Update form parameter names. - $newRow.find('select[name^="foreign_key_fields_name"]').not().first().find( - 'select[name^="destination_foreign_column"]').not().first() + $newRow.find('select[name^="foreign_key_fields_name"]') + .not($newRow.find('select[name^="foreign_key_fields_name"]').first()) + .find('select[name^="destination_foreign_column"]') + .not($newRow.find('select[name^="foreign_key_fields_name"]') + .not($newRow.find('select[name^="foreign_key_fields_name"]').first()) + .find('select[name^="destination_foreign_column"]').first()) .each(function () { $(this).parent().remove(); });