[LIVECOPY-169] Pushing not working for multiple properties Created: 14/Nov/19  Updated: 25/May/20  Resolved: 22/May/20

Status: Closed
Project: Live Copy
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Oanh Thai Hoang
Resolution: Outdated Votes: 0
Labels: maintenance
Remaining Estimate: 0d
Time Spent: 0.5d
Original Estimate: Not Specified

Issue Links:
causality
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Epic Link: Ext DAMs maintenance & partnership support
Sprint: Maintenance 8
Story Points: 3

 Description   

When pushing master content changes for a page component in which more than one property have been modified, only one of them will be pushed. You will need to push for each property changed.

Steps to reproduce with demo author

  1. Create a live copy from travel
  2. Modify about page changing the jumbotron component title and text properties
  3. Press push master content

Result: In about page in the copied tree, only one of the two modified properties has been updated.

Cause of the error is in info.magnolia.liveCopy.actions.PropagateMasterContentChangesHelper.updateMasterProperties(Node, Node), where after modifying a property, the method returns true which makes the iteration finish and not processing the rest of properties:

if (referencedNode.hasProperty(masterProperty.getName())) {
                    // If the property value changed
                    Property referencedProperty = referencedNode.getProperty(masterProperty.getName());
                    if (!masterProperty.getValue().getString().equals(referencedProperty.getValue().getString())) {
                        referencedProperty.setValue(masterProperty.getValue());
                        log.info("Updating a property for the page: {} property is: {} master content page is: {} New Value: {} Old value: {}", referencedProperty.getValue().getString(), referencedNode.getPath(),
                                referencedProperty.getName(), masterNode.getPath(), masterProperty.getValue().getString());
                        return true; <<<<<<<<<<<<<<<<<<<<<<<<<<<
                    }
                } else {
                    // This property is new
                    referencedNode.setProperty(masterProperty.getName(), masterProperty.getValue());
                    log.info("Setting a new property for the page: {} property is: {} master content page is: {}", referencedNode.getPath(), masterProperty.getName(), masterNode.getPath());
                    return true; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                } 

 



 Comments   
Comment by Jonathan Ayala [ 18/Dec/19 ]

See this comment from malupion who has already dealt with this issue.

Comment by Oanh Thai Hoang [ 21/May/20 ]

This bug can not reproduce with live-copy version 2.1.1 because this bug has been fixed since https://jira.magnolia-cms.com/browse/LIVECOPY-36

 

For reference code. See https://git.magnolia-cms.com/projects/ADDON/repos/live-copy/browse/magnolia-livecopy/src/main/java/info/magnolia/liveCopy/actions/PropagateMasterContentChangesUtil.java?at=refs%2Fheads%2Frelease%2F2.1#556,562

Generated at Mon Feb 12 02:26:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.