Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
workflow
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
workflow
Commits
04458d6d
Commit
04458d6d
authored
1 year ago
by
John Voskuilen
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2919482
: isolate Transition::updateEntityChangedTime()
parent
13621603
No related branches found
No related tags found
No related merge requests found
Pipeline
#197821
passed with warnings
1 year ago
Stage: build
Stage: validate
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Entity/WorkflowTransition.php
+9
-7
9 additions, 7 deletions
src/Entity/WorkflowTransition.php
with
9 additions
and
7 deletions
src/Entity/WorkflowTransition.php
+
9
−
7
View file @
04458d6d
...
...
@@ -665,26 +665,28 @@ class WorkflowTransition extends ContentEntityBase implements WorkflowTransition
}
/**
*
{@inheritdoc}
*
Update the workflow field of the entity in two formats.
*/
public
function
updateEntity
()
{
// Update the workflow field of the entity in two formats.
$entity
=
$this
->
getTargetEntity
();
$field_name
=
$this
->
getFieldName
();
$to_sid
=
$this
->
getToSid
();
// N.B. Align the following functions:
// - WorkflowDefaultWidget::massageFormValues();
// - WorkflowManager::executeTransition().
$items
=
$entity
->
{
$field_name
};
// $items->filterEmptyItems();
// $items->value = $to_sid;
// $entity->{$field_name}->value = $to_sid;
$items
->
setValue
(
$to_sid
);
$items
->
__set
(
'_workflow_transition'
,
$this
);
// Populate the entity changed timestamp when the option is checked.
$this
->
updateEntityChangedTime
();
}
/**
* Update the Entity's ChangedTime when the option is set.
*/
public
function
updateEntityChangedTime
()
{
if
(
$this
->
getWorkflow
()
->
getSetting
(
'always_update_entity'
))
{
$entity
=
$this
->
getTargetEntity
();
// Copied from EntiyFormDisplay::updateChangedTime(EntityInterface $entity) {
if
(
$entity
instanceof
EntityChangedInterface
)
{
// $entity->setChangedTime($this->time->getRequestTime());
...
...
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