[MGNLPN-396] Variant node name can be changed when choosing audience Created: 10/Aug/17 Updated: 11/Mar/21 Resolved: 11/Mar/21 |
|
| Status: | Closed |
| Project: | Magnolia Personalization |
| Component/s: | Integration, Preview App |
| Affects Version/s: | 1.4.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Mercedes Iruela | Assignee: | Unassigned |
| Resolution: | Obsolete | Votes: | 3 |
| Labels: | maintenance | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| 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: | Support | ||||||||||||||||||||
| Description |
|
If a page template has the property named name and a variant of this page is created when the audience of the variant is selected. The variant node name is updated to the name defined in property name. It is done in info.magnolia.ui.dialog.action.SaveDialogAction
/**
* Set the node Name.
* Node name is set to: <br>
* the value of the property 'name' if it is present.
*/
protected void setNodeName(Node node, JcrNodeAdapter item) throws RepositoryException {
String propertyName = "name";
if (node.hasProperty(propertyName) && !node.hasProperty(ModelConstants.JCR_NAME)) {
Property property = node.getProperty(propertyName);
String newNodeName = property.getString();
if (!node.getName().equals(Path.getValidatedLabel(newNodeName))) {
newNodeName = Path.getUniqueLabel(node.getSession(), node.getParent().getPath(), Path.getValidatedLabel(newNodeName));
item.setNodeName(newNodeName);
NodeUtil.renameNode(node, newNodeName);
}
}
}
This issue makes the variant node has the same name as the parent node, instead of the expected "variant-x". This issue is causing issues with variants logic, for example, if you try to Preview the variant as visitor, an infinite loop is executed. You can find more information in linked support ticket. In this case the loop was caused by cmsfn.siteRoot(content) |
| Comments |
| Comment by Nuno Cruz [ 04/Sep/17 ] |
|
A new piece of information, if people are using the URL Trans module, this module adds the property name to the page. So if there are people using it, they will also experience this issue. Originally I thought our dialog was responsible for this property, but after having the client reporting some issues with translations I found this. |
| Comment by Mariusz Chruscielewski [ 04/Sep/17 ] |
|
This is the module Nuno is reffering to: https://mvnrepository.com/artifact/com.eqs.magnolia.urltrans/magnolia-module-urltrans/4.0 |
| Comment by Richard Gange [ 30/Sep/20 ] |
|
Since we don't make fixes to Magnolia modules to accommodate incubator modules the solution to this issue will be to provide a groovy script which can migrate the property names for the page name translation. The module already provides a configuration for the name of this property in the module config. See URL Translation. |
| Comment by Roman Kovařík [ 11/Mar/21 ] |
|
Can't reproduced in new framework (jcrName is used for renaming) https://demo.magnolia-cms.com/.magnolia/admincentral#app:pages-app:browser;/travel/contact/variants/variant-1:: |