diff --git a/core/modules/contextual/js/contextual.js b/core/modules/contextual/js/contextual.js index 31f4c83918..8c67eae70f 100644 --- a/core/modules/contextual/js/contextual.js +++ b/core/modules/contextual/js/contextual.js @@ -157,8 +157,10 @@ // Collect the IDs for all contextual links placeholders. var ids = []; $placeholders.each(function () { - if ($.inArray($(this).attr('data-contextual-id'), ids) < 0) - ids.push($(this).attr('data-contextual-id')); + // Add the contextual link ID if it hasn't been added already. + if ($.inArray($(this).attr('data-contextual-id'), ids) < 0) { + ids.push($(this).attr('data-contextual-id')); + } }); // Update all contextual links placeholders whose HTML is cached.