Magnolia 5.4 reached end of life on November 15, 2018. This branch is no longer supported, see End-of-life policy.
This page provides a recommended approach to avoid any inconsistent configuration occurring when you upgrade a custom Magnolia bundle with STK, Multisite, Site and Site app modules.
If you upgrade the STK module in a custom bundle before installing the site-app module, you may encounter issues with the rootPath and app launcher configuration.
You encounter these issues if, for example, you:
The script provided below cleans up your configuration by:
rootPath value.See the Groovy module and Groovy app for information about how to execute Groovy scripts on a running Magnolia instance.
Paste the following script into the Source field.
session = ctx.getJCRSession('config')
updatedConfig = false
def removeNode(absPath) {
if (session.nodeExists(absPath)) {
println "Removing config:$absPath ..."
session.removeItem(absPath)
updatedConfig = true
}
}
if (session.nodeExists('/modules/multisite') && session.nodeExists('/modules/site-app') && session.nodeExists('/modules/standard-templating-kit')) {
println "Detected multisite, site-app and stk modules. Let's see if configuration needs some clean up..."
siteAppContentConnector = session.getNode('/modules/site-app/apps/site/subApps/browser/contentConnector')
if ('/modules/site/config/site'.equals(PropertyUtil.getString(siteAppContentConnector, 'rootPath'))) {
println 'Replacing config:/modules/site-app/apps/site/subApps/browser/contentConnector@rootPath value /modules/site/config/site with /modules/multisite/config/sites ...'
PropertyUtil.setProperty(siteAppContentConnector, 'rootPath', '/modules/multisite/config/sites')
updatedConfig = true
}
removeNode('/modules/ui-admincentral/apps/stkSiteApp')
removeNode('/modules/ui-admincentral/config/appLauncherLayout/groups/stk/apps/stkSiteApp')
removeNode('/modules/ui-admincentral/apps/stkThemesApp')
removeNode('/modules/ui-admincentral/config/appLauncherLayout/groups/stk/apps/stkThemesApp')
session.save()
}
if (updatedConfig) {
return 'Configuration cleaned up. Bye.'
} else {
return 'Nothing to do here. Bye.'
}
Save the script and run it after upgrading.