[MAGNOLIA-3968] Improve saveHandler for multiSelect controls to handle single-valued properties Created: 10/Feb/12 Updated: 10/Mar/21 Resolved: 10/Mar/21 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | admininterface, core, gui |
| Affects Version/s: | 4.4.2, 4.4.3, 4.4.4, 4.4.5, 4.4.6 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Richard Unger | Assignee: | Unassigned |
| Resolution: | Outdated | Votes: | 2 |
| Labels: | controls, dialogs, multiselect | ||
| 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)
|
||||||||||||||||
| Date of First Response: | |||||||||||||||||
| Description |
|
We are faced with the following problems, which are really 2 instances of the same problem: 1. We changed a control in one of our dialogs to use multiselect rather than single-select (originally the customer wanted one category, then changed their mind and wanted multiple categories to be assignable to the content) 2. We observed that data imported from XML had problems with the multiselect for categories The problem is that the multiselect control does not work if the node already contains a single-valued property of the same name. In both cases the behaviour is the same: when an editor wants to edit the content using the dialog, the existing (single-valued) property is not displayed in the multiselect control. If the user sets new values in the multiselect control, the dialog cannot be saved as there is an exception in the saveHandler when it finds the existing single-valued property. The solution has 2 parts: A) when loading the value in multiselect control, if a single-valued property is present, load it anyway and assume it is a solo element of a multi-valued property. It seems to me this should be handled by B) when storing the value, if a single-valued property is present, delete the property before storing, so that a new multi-valued property is created. |
| Comments |
| Comment by Jan Haderka [ 11/Feb/12 ] |
|
Hi Richard, unfortunately as mentioned in Jan |
| Comment by Richard Unger [ 13/Feb/12 ] |
|
Hi Jan, I understand the Bug is Jackrabbit's... my proposal is more for a kind of work-around. By solving the problem in the way I describe, "bad" values would automatically fix themselves when they're saved. Do I understand your comment correctly?: that Thanks, Richard |
| Comment by Jan Haderka [ 14/Feb/12 ] |
|
Yes, that's exactly the problem. In very old versions of Magnolia NodeData vas not very good at dealing with multiple values and lots of old code manipulated Value objects directly. Some of that code is still around it seems. |