Details
-
Improvement
-
Resolution: Won't Fix
-
Major
-
None
-
1.6.3
-
None
-
-
Yes
-
Empty show more show less
Description
The patch for MGNLDATA-130 opened a few other logical problems: in the code of GenericDataAdminTree, if the node is renamed, the dialog "nameField" property is read and the corresponding property is set with the new node name, or worse, a new "name" property is created with the new node name, even if it was not present in the beginning.
This is not always the desired behaviour, because the name used in the tree may have spaces and special characters removed, but the node data inside the node can have spaces and special characters.
Logically speaking, I may want a field that is strongly coupled with node name, which is the current intention of the code, so whether I edit it in the tree or in a dialog it stays synchronized on both sides. And in this case we should alter the data save handler to write the name field just like the name used in the tree (spaces and special chars removed/escaped), to be perfectly consistent.
On the other side I may simply want a name field that is just used once to give a reasonable name to new nodes, just to avoid the 0, 00, 01, etc which usually have no meaning for the end user. This value should be used either once at creation or each time that value change, but only in the nodeData->name direction and never in the opposite one.
What do you think? I'm asking something too complex? I'd do this adding a "oneWayNameField" boolean in the dialog configuration, making GenericDataAdminTree check also for this before renaming, and making saveHandler check for this when saving the node, and changing the name value accordingly (leaving as is or using the tree name also for the node data value).
Attached a simple patch for GenericDataAdminTree change. If there is a node data "oneWayNameField" set as true, the node name field is not changed when the node is renamed.
Checklists
Attachments
Issue Links
- depends upon
-
MGNLDATA-130 Error while renaming sub-items.
-
- Closed
-