Uploaded image for project: 'Live Copy'
  1. Live Copy
  2. LIVECOPY-169

Pushing not working for multiple properties

    XMLWordPrintable

Details

    • Bug
    • Resolution: Outdated
    • Neutral
    • None
    • None

    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; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                      } 

       

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              oanh.thai Oanh Thai Hoang
              jayala Jonathan Ayala
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD

                  Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0d
                    0d
                    Logged:
                    Time Spent - 0.5d
                    0.5d