From ce4e04f054373f1292b599907e7ea7a735066920 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org> Date: Mon, 12 Sep 2016 13:41:40 +0100 Subject: [PATCH] Issue #2797967 by tim.plunkett: Field UI needlessly resaves each enabled entity display --- core/modules/field_ui/src/Form/EntityDisplayFormBase.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php index 20e1487b01b0..586f1ef39190 100644 --- a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php +++ b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php @@ -876,8 +876,12 @@ protected function getDisplayStatuses() { protected function saveDisplayStatuses($display_statuses) { $displays = $this->getDisplays(); foreach ($displays as $display) { - $display->set('status', $display_statuses[$display->get('mode')]); - $display->save(); + // Only update the display if the status is changing. + $new_status = $display_statuses[$display->get('mode')]; + if ($new_status !== $display->status()) { + $display->set('status', $new_status); + $display->save(); + } } } -- GitLab