Skip to content
Snippets Groups Projects
Commit cbe479ba authored by mxh's avatar mxh
Browse files

Issue #3261414 by mxh, jurgenhaas, goldin: Add or remove a value or values from a multi-value field

parent c3d2c9bc
No related branches found
No related merge requests found
......@@ -152,8 +152,12 @@ abstract class FieldUpdateActionBase extends ActionBase implements OptionsInterf
if (empty($values) && !empty($current_values) && ($this->configuration['method'] === 'set:clear')) {
// Shorthand for setting a field to be empty.
$current_values = [];
$values_changed = TRUE;
$update_target->setValue([]);
foreach ($metadata['entities'] as $entity_to_save) {
if (!in_array($entity_to_save, $all_entities_to_save, TRUE)) {
$all_entities_to_save[] = $entity_to_save;
}
}
continue;
}
......@@ -183,7 +187,7 @@ abstract class FieldUpdateActionBase extends ActionBase implements OptionsInterf
}
}
if ((reset($method_settings) !== 'remove') && (count($existing) === count($values))) {
if ((reset($method_settings) !== 'remove') && (count($existing) === count($values)) && (count($existing) === count($current_values))) {
continue;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment