[MAGNOLIA-8834] ContentMap doesn't consider the possibility that some reference options are arrays Created: 17/Mar/23 Updated: 18/Jun/23 Resolved: 12/Jun/23 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 6.2.29 |
| Fix Version/s: | 6.3.0, 6.2.36 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Carlos Cantalapiedra | Assignee: | Quach Hao Thien |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | 2d 3h | Time Spent: | 2d 3h |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| Attachments: |
|
|||||||||||||||||||||||||
| Issue Links: |
|
|||||||||||||||||||||||||
| Sub-Tasks: |
|
|||||||||||||||||||||||||
| Template: |
|
|||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
|||||||||||||||||||||||||
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
|||||||||||||||||||||||||
| Release notes required: |
Yes
|
|||||||||||||||||||||||||
| Date of First Response: | ||||||||||||||||||||||||||
| Epic Link: | Nucleus Quality Maintenance | |||||||||||||||||||||||||
| Sprint: | Nucleus 38 | |||||||||||||||||||||||||
| Story Points: | 2 | |||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||
| Work Started: | ||||||||||||||||||||||||||
| Approved: |
Yes
|
|||||||||||||||||||||||||
| Description |
|
When the ContentMap class is used for retrieve a REFERENCE property as jcr:predecessor it will fail because the get method won't consider it as multivalue. It would be better to include at the else if (type == PropertyType.REFERENCE) statement another check like "if (prop.isMultiple())" so for those cases like jcr:predecessors, it won't thrown error as:
The groovy script to simulate the bug: scripts.getMultiReferencesProperty.xml Steps:
Actual result:logs: WARN info.magnolia.jcr.util.ContentMap : Failed to retrieve jcr:predecessors on node /test with property /test/jcr:predecessors is a multi-valued property, so it's values can only be retrieved as an array Expected result:support multivalue for jcr:predecessor propertives on ContentMap |
| Comments |
| Comment by Quach Hao Thien [ 24/May/23 ] |
Discovery
|
| Comment by Quach Hao Thien [ 12/Jun/23 ] |
SolutionContentMap is now able to return an array of referenced node when it is called to retrieve the value of jcr:predecessors property (or whatever referenced property), which is a multiple value one |