Skip to content
Snippets Groups Projects

Issue #3401973: If no changes on content, don't update field values.

Merged Marco Fernandes requested to merge issue/gutenberg-3401973:cherry-pick-7762befd into 8.x-2.x
1 file
+ 10
0
Compare changes
  • Side-by-side
  • Inline
@@ -73,11 +73,21 @@ class MappingFieldsHelper implements ContainerInjectionInterface {
}
$field_content = $entity->get($text_fields[0])->getString();
$original_field_content = '';
if ($entity->original) {
$original_field_content = $entity->original->get($text_fields[0])->getString();
}
// Fetch only blocks with mapping fields.
$block_parser = new BlockParser();
$blocks = $block_parser->parse($field_content, [$this, 'filterMappingFieldsBlock']);
// If content hasn't changed, no need to update fields.
if ($field_content === $original_field_content) {
return;
}
// Let's build the field's array of values.
$fields = [];
$filter_formats = filter_formats();
Loading