diff --git a/core/lib/Drupal/Core/Menu/MenuTreeStorage.php b/core/lib/Drupal/Core/Menu/MenuTreeStorage.php index 858ca60..c50f7b4 100644 --- a/core/lib/Drupal/Core/Menu/MenuTreeStorage.php +++ b/core/lib/Drupal/Core/Menu/MenuTreeStorage.php @@ -299,7 +299,12 @@ protected function doSave(array $link) { $affected_menus[$original['menu_name']] = $original['menu_name']; $fields = $this->preSave($link, $original); // If $link matches the $original data then exit early as there are no - // changes to make. Note that $fields will not contain the mlid key. + // changes to make. Use array_diff_assoc() to check if they match because: + // - Some of the data types of the values are not the same. The values + // in $original are all strings because they have come from database but + // $fields contains typed values. + // - MenuTreeStorage::preSave() removes the 'mlid' from $fields. + // - The order of the keys in $original and $fields is different. if (array_diff_assoc($fields, $original) == [] && array_diff_assoc($original, $fields) == ['mlid' => $link['mlid']]) { return $affected_menus; }