[MAGNOLIA-8961] JCR import command fails when replacing existing nodes Created: 20/Jun/23 Updated: 18/Sep/23 Resolved: 29/Aug/23 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | None |
| Affects Version/s: | 6.2.35 |
| Fix Version/s: | 6.3.0, 6.2.39 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Jonathan Ayala | Assignee: | Antonín Juran |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | VN-Testing, quickwin | ||
| Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
| Σ Time Spent: | 3d 7h | Time Spent: | 3d 7h |
| Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
| 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: |
[X]*
Steps to reproduce, expected, and actual results filled
[X]*
Affected version filled
|
|||||||||||||||||||||||||
| Release notes required: |
Yes
|
|||||||||||||||||||||||||
| Documentation update required: |
Yes
|
|||||||||||||||||||||||||
| Date of First Response: | ||||||||||||||||||||||||||
| Sprint: | Nucleus 42, Nucleus 43 | |||||||||||||||||||||||||
| Story Points: | 5 | |||||||||||||||||||||||||
| Team: | ||||||||||||||||||||||||||
| Work Started: | ||||||||||||||||||||||||||
| Approved: |
Yes
|
|||||||||||||||||||||||||
| Description |
| Comments |
| Comment by Quach Hao Thien [ 13/Jul/23 ] |
DiscoveryThe problem comes from this line. It's supposed to process the stream of children nodes right before importing process, but the importing process has already actually affected that stream. So the stream doesn't contain the children nodes before importing process as we expected but it contains the children node after importing. The unexpected result of the children nodes stream leads to the wrong filter predicate at this line, so the whereClause variable will be empty, and the statement will end up with an empty WHERE String statement = "SELECT * FROM [nt:resource] WHERE " + whereClause; Proposed solution:This code https://git.magnolia-cms.com/projects/PLATFORM/repos/main/browse/magnolia-core/src/main/java/info/magnolia/importexport/command/JcrImportCommand.java?at=refs%2Fheads%2Frelease%2F6.2#108 should take place before the importing
Set<String> childNodeNamesBeforeImport = asStream(childNodesBeforeImport)
.map(NodeUtil::getNodePathIfPossible)
.collect(Collectors.toSet());
|
| Comment by Loris Croci [ 30/Aug/23 ] |
|
hello @quach thanks |
| Comment by Quach Hao Thien [ 30/Aug/23 ] |
|
Hi loris.croci , This ticket is integrated into 6.3.0 and 6.2.39. I don't have the information about releasing atm. |
| Comment by Quach Hao Thien [ 12/Sep/23 ] |
|
Hi loris.croci , FYI, Magnolia 6.2.39 will be released by Monday 18th September at the latest. |