[MAGNOLIA-8505] ChangeAllPropertiesWithCertainValueTask fails on multivalue properties Created: 18/Jul/22 Updated: 13/Oct/22 Resolved: 13/Oct/22 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 6.2.21 |
| Fix Version/s: | 6.3.0, 6.2.26 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Jonathan Ayala | Assignee: | Marek Strucka |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
| Σ 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)
|
|||||||||||||||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
|||||||||||||||||||||||||
| Epic Link: | Nucleus Quality Maintenance | |||||||||||||||||||||||||
| Sprint: | DevX 21 | |||||||||||||||||||||||||
| Story Points: | 2 | |||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||
| Description |
|
Currently, delta task info.magnolia.module.delta.ChangeAllPropertiesWithCertainValueTask only works with single String values. It would be useful if this task also worked with multivalue properties. Instead, it throws an exception if there's a multivalued property and the execution is interrupted. Steps to reproduce
Expected resultsTest property is modified during installation/update task Actual resultsThere's an error and test property is not modified ERROR info.magnolia.module.InstallContextImpl : [0/3 tasks - custom-module Magnolia Module (version 1.2.0)]> Could not install or update custom-module module. Task 'Change value of all properties with certain value.' failed. (ValueFormatException: property /test2/main/0/assignedSegments is a multi-valued property, so it's values can only be retrieved as an array) info.magnolia.module.delta.TaskExecutionException: Could not execute task: Value format: property /test2/main/0/assignedSegments is a multi-valued property, so it's values can only be retrieved as an array at info.magnolia.module.delta.AbstractRepositoryTask.execute(AbstractRepositoryTask.java:59) ~[magnolia-core-6.2.20.jar:?] at info.magnolia.module.ModuleManagerImpl.applyDeltas(ModuleManagerImpl.java:491) ~[magnolia-core-6.2.20.jar:?] at info.magnolia.module.ModuleManagerImpl.installOrUpdateModule(ModuleManagerImpl.java:473) ~[magnolia-core-6.2.20.jar:?] at info.magnolia.module.ModuleManagerImpl$1.doExec(ModuleManagerImpl.java:271) ~[magnolia-core-6.2.20.jar:?] at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:407) ~[magnolia-core-6.2.20.jar:?] at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:404) ~[magnolia-core-6.2.20.jar:?] at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:378) ~[magnolia-core-6.2.20.jar:?] at info.magnolia.module.ModuleManagerImpl.performInstallOrUpdate(ModuleManagerImpl.java:265) ~[magnolia-core-6.2.20.jar:?] at info.magnolia.module.ui.ModuleManagerWebUI$2.run(ModuleManagerWebUI.java:126) ~[magnolia-core-6.2.20.jar:?] at java.lang.Thread.run(Thread.java:745) ~[?:1.8.0_121] Caused by: javax.jcr.ValueFormatException: property /test2/main/0/assignedSegments is a multi-valued property, so it's values can only be retrieved as an array at org.apache.jackrabbit.core.PropertyImpl.internalGetValue(PropertyImpl.java:483) ~[jackrabbit-core-2.20.4.jar:2.20.4] at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:510) ~[jackrabbit-core-2.20.4.jar:2.20.4] at org.apache.jackrabbit.core.PropertyImpl.getString(PropertyImpl.java:520) ~[jackrabbit-core-2.20.4.jar:2.20.4] at info.magnolia.module.delta.ChangeAllPropertiesWithCertainValueTask.doExecute(ChangeAllPropertiesWithCertainValueTask.java:106) ~[magnolia-core-6.2.20.jar:?] at info.magnolia.module.delta.AbstractRepositoryTask.execute(AbstractRepositoryTask.java:57) ~[magnolia-core-6.2.20.jar:?] ... 9 more Development notesThe error occurs in line 129 of info.magnolia.module.delta.ChangeAllPropertiesWithCertainValueTask, where a conditional statement could be added in order to avoid the javax.jcr.ValueFormatException
if (property.getString().equals(currentValue)) {
|