Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
222
Issues
222
List
Boards
Labels
Service Desk
Milestones
Merge Requests
33
Merge Requests
33
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
4572a649
Commit
4572a649
authored
2 days ago
by
Guy Thouret
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix) Media post was updating the wrong activity field -
#616
parent
31cffea2
chore/616-propogate-props
1 merge request
!303
Propagate Properties when entities get updated
Pipeline
#82365278
pending with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
PropagateProperties.php
Core/Media/Delegates/PropagateProperties.php
+4
-4
PropagatePropertiesSpec.php
Spec/Core/Media/Delegates/PropagatePropertiesSpec.php
+3
-3
No files found.
Core/Media/Delegates/PropagateProperties.php
View file @
4572a649
...
...
@@ -22,8 +22,8 @@ class PropagateProperties extends Properties
*/
public
function
toActivity
(
$from
,
Activity
$to
)
:
Activity
{
if
(
$this
->
valueHasChanged
(
$from
->
title
,
$to
->
get
(
'title'
)))
{
$to
->
set
(
'title'
,
$from
->
title
);
if
(
$this
->
valueHasChanged
(
$from
->
title
,
$to
->
get
Message
(
)))
{
$to
->
set
Message
(
$from
->
title
);
}
$fromData
=
$from
->
getActivityParameters
();
...
...
@@ -43,8 +43,8 @@ class PropagateProperties extends Properties
*/
public
function
fromActivity
(
Activity
$from
,
$to
)
{
if
(
$this
->
valueHasChanged
(
$from
->
get
(
'title'
),
$to
->
title
))
{
$to
->
title
=
$from
->
get
(
'title'
);
if
(
$this
->
valueHasChanged
(
$from
->
get
Message
(
),
$to
->
title
))
{
$to
->
title
=
$from
->
get
Message
(
);
}
return
$to
;
...
...
This diff is collapsed.
Click to expand it.
Spec/Core/Media/Delegates/PropagatePropertiesSpec.php
View file @
4572a649
...
...
@@ -29,8 +29,8 @@ class PropagatePropertiesSpec extends ObjectBehavior
public
function
it_should_propagate_changes_to_activity
()
{
$this
->
entity
->
get
(
'title'
)
->
shouldBeCalled
()
->
willReturn
(
'new title'
);
$this
->
activity
->
get
(
'title'
)
->
shouldBeCalled
()
->
willReturn
(
'old title'
);
$this
->
activity
->
set
(
'title'
,
'new title'
)
->
shouldBeCalled
();
$this
->
activity
->
get
Message
(
)
->
shouldBeCalled
()
->
willReturn
(
'old title'
);
$this
->
activity
->
set
Message
(
'new title'
)
->
shouldBeCalled
();
$activityParameters
=
[
'batch'
,
...
...
@@ -49,7 +49,7 @@ class PropagatePropertiesSpec extends ObjectBehavior
public
function
it_should_propogate_properties_from_activity
()
{
$this
->
activity
->
get
(
'title'
)
->
shouldBeCalled
()
->
willReturn
(
'new title'
);
$this
->
activity
->
get
Message
(
)
->
shouldBeCalled
()
->
willReturn
(
'new title'
);
$this
->
entity
->
get
(
'title'
)
->
shouldbeCalled
()
->
willReturn
(
'old title'
);
$this
->
entity
->
set
(
'title'
,
'new title'
)
->
shouldBeCalled
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment