[LIVECOPY-162] The action "push master content changes" will not push all changed properties Created: 16/Sep/19  Updated: 01/Sep/20  Resolved: 01/Sep/20

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

Type: Bug Priority: Critical
Reporter: Jürgen Ulrich Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Bildschirmfoto 2019-09-16 um 17.45.15.png    
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

 Description   

Hi Magnolia Team,

with live copy version 3.1 the action "push master content changes" will not push all properties to the slaves.
The problem is, that the method updateMasterProperties in the PropagateMasterContentChangesHelper returns true after it finds one property that has changed (see code line 536 and 542 - Bildschirmfoto 2019-09-16 um 17.45.15.png). Instead this boolean value has to be saved to a variable and has to be returned at the end of the function (outside the while loop). Otherwise only one property will be handled.

The updateMasterProperties method should look something like this:

private boolean updateMasterProperties(Node masterNode, Node referencedNode) throws RepositoryException {
        boolean propertyChanged = false;
        PropertyIterator masterProperties = masterNode.getProperties();
        while (masterProperties.hasNext()) {
            Property masterProperty = masterProperties.nextProperty();

            if (isPropertyExcluded(referencedNode, masterProperty.getName())) {
                continue;
            }

            if (masterProperty.isMultiple()) {
                if (referencedNode.hasProperty(masterProperty.getName())) {
                    referencedNode.setProperty(masterProperty.getName(), masterProperty.getValues());
                }
            } else {
                // If the slave node has this kind of property then
                // update it
                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());
                        propertyChanged = 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());
                    propertyChanged = true;
                }
            }
        }
        return propertyChanged;
    }

Thanks and best regards
Jürgen



 Comments   
Comment by Laura Delnevo [ 23/Sep/19 ]

Hi juergenulrich thank you for flagging Live Copy issues and suggesting a few enhancements too! Whilst the team is happy to review existing tickets, could I please ask you to raise any new critical issues through the Support project? This way we can ensure a quicker response and validation of the issues that otherwise might take a little longer for us to pick up. Thank you, Laura 

Comment by Jürgen Ulrich [ 23/Sep/19 ]

Hi @Laura Delnevo, oh sorry, yes of course. Unfortunately I forgot the support project.
Thanks & best Jürgen

Comment by Laura Delnevo [ 01/Sep/20 ]

The issue is fixed on the released 6.2 version. As 6.1 is in its grace period, we won't fix this issue on this version as its reaching end-of-life (only critical and security issues are tackled at the moment for 6.1)

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