[
http://jira.magnolia-cms.com/browse/MGNLDATA-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Danilo Ghirardelli updated MGNLDATA-131:
----------------------------------------
Patch included: [Yes]
Attachment: oneWay.patch
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.
was:
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).
> Optionally use the name field only for new nodes, and avoid back-renaming.
> --------------------------------------------------------------------------
>
> Key: MGNLDATA-131
> URL: http://jira.magnolia-cms.com/browse/MGNLDATA-131
> Project: Magnolia Data Module
> Issue Type: Improvement
> Affects Versions: 1.6.3
> Reporter: Danilo Ghirardelli
> Assignee: Philipp Bärfuss
> Priority: Major
> Attachments: oneWay.patch
>
>
> 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------