Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eca-3363022
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
eca-3363022
Commits
cbe479ba
Commit
cbe479ba
authored
2 years ago
by
mxh
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3261414
by mxh, jurgenhaas, goldin: Add or remove a value or values from a multi-value field
parent
c3d2c9bc
No related branches found
Tags
previous/3261414-add-or-remove-2/2022-03-17
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/content/src/Plugin/Action/FieldUpdateActionBase.php
+7
-3
7 additions, 3 deletions
modules/content/src/Plugin/Action/FieldUpdateActionBase.php
with
7 additions
and
3 deletions
modules/content/src/Plugin/Action/FieldUpdateActionBase.php
+
7
−
3
View file @
cbe479ba
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment