From 0dcce426a4fc97b0e4c8a8aa447422ba94c939e4 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Wed, 22 Aug 2018 22:47:04 +0300 Subject: [PATCH] Reindex 'key_indicies' after item delete The "keys.splice(i, 1)" removes one item at the specified position from an array. Thus hashes which are stored at "that._key_indicies" are no longer valid and should be reindexed. Fixes: https://pagure.io/freeipa/issue/7678 Reviewed-By: Serhii Tsymbaliuk --- install/ui/src/libs/jquery.ordered-map.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install/ui/src/libs/jquery.ordered-map.js b/install/ui/src/libs/jquery.ordered-map.js index 4d3be294b..9b8b477d7 100644 --- a/install/ui/src/libs/jquery.ordered-map.js +++ b/install/ui/src/libs/jquery.ordered-map.js @@ -112,6 +112,11 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function(map) { that.keys.splice(i, 1); that.values.splice(i, 1); delete that._key_indicies[key]; + + // reindex + for (var j=i; j