[MGNLMIGRATION-1] Check if a node exist before operating on it Created: 07/Mar/12  Updated: 25/Jul/12  Resolved: 07/Mar/12

Status: Closed
Project: Migration 4.4 to 4.5 (closed)
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.1

Type: Bug Priority: Critical
Reporter: Samuel Schmitt Assignee: Samuel Schmitt
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File BuildDialogIdMap.groovy.patch     Text File ExtraSTKTasks.groovy.patch     Text File Migration.groovy.patch     Text File MigrationUtil.groovy.patch     Text File RemoveTemplateToPrototypeRedundancy.groovy.patch    
Issue Links:
dependency
is depended upon by MGNLMIGRATION-24 STK Migration script can fail if a mo... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

When migrating other modules than the ones from the default migration, it often happen that an "PathNotFound" error occurs.



 Comments   
Comment by Matt Dertinger [ 08/Mar/12 ]

Hi Samuel,

I saw you made some fixes regarding this issue. I ran into similar problems in some of the other migration scripts. See the attached patches.

btw, there's one more on the way.

Let me know what you think, or if you have any questions.

Cheers,
Matt

Comment by Matt Dertinger [ 08/Mar/12 ]

Hi Samuel,

Ok, all four patch files are attached.

Cheers,
Matt

Comment by Samuel Schmitt [ 08/Mar/12 ]

Thanks for the patches, I will update everything !!

Comment by Matt Dertinger [ 09/Mar/12 ]

Hi Samuel,

Found other occurrence in ExtraSTKTasks.groovy, see attached patch.

Also, there are two other scripts that I have questions about.

The first one is: TransformExtends.groovy, within the prepareAndCreateSTKComparisonMap method there is the following:

def genericNode = hm.getContent(modulePath+"dialogs/generic")
def masterNode = genericNode.createContent("master")
def changeTeaserMap = ["/tabLinkList" : ""]
genericNode.save()

My question is, do you think this could be revised to handle cases where the migration scripts fail during the update process? Currently, if this happens you can end up with duplicate master nodes. I was thinking maybe the above code could be changed to the following instead?

def genericNode = hm.getContent(modulePath+"dialogs/generic")
def masterNode = genericNode.getOrCreateContent("master")
def changeTeaserMap = ["/tabLinkList" : ""]
genericNode.save()

The second script I have a question about is: TransformSTKTemplates.groovy, within the migrateTemplateDefinition method, there is the following:

createContentNavigationArea(template)

Similar to my first question, calling this method here doesn't first check to see if the contentNavigation node already exists. Therefore, it's possible to end up with duplicate contentNavigation nodes.

Let me know your thoughts.

Cheers,
Matt

Generated at Mon Feb 12 10:16:14 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.