Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
radioactivity
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
radioactivity
Commits
987b7a83
Commit
987b7a83
authored
1 year ago
by
Robert Phillips
Committed by
Thomas de Graaff
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3348337
: Set syncing when updating reference fields
parent
fe58a5af
No related branches found
No related tags found
1 merge request
!8
Issue #3348337: Set syncing when updating reference fields
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/RadioactivityReferenceUpdater.php
+4
-0
4 additions, 0 deletions
src/RadioactivityReferenceUpdater.php
tests/src/Unit/RadioactivityReferenceUpdaterTest.php
+1
-0
1 addition, 0 deletions
tests/src/Unit/RadioactivityReferenceUpdaterTest.php
with
5 additions
and
0 deletions
src/RadioactivityReferenceUpdater.php
+
4
−
0
View file @
987b7a83
...
...
@@ -6,6 +6,7 @@ use Drupal\Component\Datetime\TimeInterface;
use
Drupal\Core\Entity\EntityFieldManagerInterface
;
use
Drupal\Core\Entity\EntityTypeManagerInterface
;
use
Drupal\Core\Entity\FieldableEntityInterface
;
use
Drupal\Core\Entity\SynchronizableInterface
;
use
Drupal\radioactivity\Entity\Radioactivity
;
/**
...
...
@@ -109,6 +110,9 @@ class RadioactivityReferenceUpdater implements RadioactivityReferenceUpdaterInte
}
if
(
$entityIsUpdated
)
{
if
(
$entity
instanceof
SynchronizableInterface
)
{
$entity
->
setSyncing
(
TRUE
);
}
$entity
->
save
();
}
...
...
This diff is collapsed.
Click to expand it.
tests/src/Unit/RadioactivityReferenceUpdaterTest.php
+
1
−
0
View file @
987b7a83
...
...
@@ -209,6 +209,7 @@ class RadioactivityReferenceUpdaterTest extends UnitTestCase {
$entity
->
getEntityTypeId
()
->
willReturn
(
'node'
);
$entity
->
bundle
()
->
willReturn
(
'article'
);
$entity
->
get
(
'field_rar'
)
->
willReturn
(
$fieldItemList
);
$entity
->
setSyncing
(
TRUE
)
->
willReturn
(
TRUE
);
$entity
->
save
()
->
shouldBeCalledTimes
(
$entityIsUpdated
?
1
:
0
);
// The return value of ::getReferenceFields are the configured fields
...
...
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