[magnolia-dev] [JIRA] (DOCU-1020) Document issue with site-app when following a custom upgrade path
"JIRA (on behalf of Federico Grilli)" <jira-O8DnXSz/[email protected]>
| Newsgroups | gmane.comp.cms.magnolia.devel |
|---|---|
| Message-ID | <[email protected]> |
Federico Grilli updated an issue
Documentation / https://jira.magnolia-cms.com/browse/DOCU-1020 DOCU-1020
Document issue with site-app when following a custom upgrade path
Change By:
Federico Grilli
As mentioned by [~ahietala] in the comment section of MGNLSITE-59, we need to document how to get rid of the inconsistent configuration one might end up with when following a custom upgrade path in an installation with STK, multisite and site-app (for further details see the description of the related app).
The basic idea is to use a Groovy script which will do the required replacements and deletions. Not sure where exactly in the documentation all this could be mentioned. At any rate, here is the Groovy script to fix the borked config. One can simply execute it via GroovyApp in Magnolia.
{code}
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
}
if removeNode ( session.nodeExists( '/modules/ui-admincentral/apps/stkSiteApp') ) {
println 'Removing config:/modules/ui-admincentral/apps/stkSiteApp ...'
session.removeItem removeNode ('/modules/ui-admincentral/ apps/stkSiteApp')
}
if (session.nodeExists('/modules/ui-admincentral/ config/appLauncherLayout/groups/stk/apps/stkSiteApp') ) {
println removeNode( ' Removing config: /modules/ui-admincentral/ config/appLauncherLayout/groups/stk/ apps/ stkSiteApp ... stkThemesApp ' )
session.removeItem removeNode ('/modules/ui-admincentral/config/appLauncherLayout/groups/stk/apps/ stkSiteApp')
}
if (session.nodeExists('/modules/ui-admincentral/apps/ stkThemesApp') ) {
println 'Removing config:/modules/ui-admincentral/apps/stkThemesApp ...'
session. removeItem save ( '/modules/ui-admincentral/apps/stkThemesApp' )
}
if ( session.nodeExists('/modules/ui-admincentral/config/appLauncherLayout/groups/stk/apps/stkThemesApp' updatedConfig ) ) {
println return ' Removing config:/modules/ui-admincentral/config/appLauncherLayout/groups/stk/apps/stkThemesApp Configuration cleaned up . Bye . . '
session.removeItem('/modules/ui-admincentral/config/appLauncherLayout/groups/stk/apps/stkThemesApp')
} else {
session.save()
}
return ' All done Nothing to do here . Bye. '
}
{code}
As to a way to reproduce the inconsistent situation originally reported I did this
- step 1 install magnolia 5.4.3 EE (STK 2.9.2) w/o site-app
- step 2 upgrade to 5.4.4 (STK 2.9.3) still w/o site-app
- step 3
-- add site-app 1.0.5
-- upgrade to site-module 1.0.5
-- upgrade to imaging-support 3.2.5 (needed by site-module 1.0.5)
https://jira.magnolia-cms.com/browse/DOCU-1020#add-comment
Add Comment
This message was sent by Atlassian JIRA (v7.2.6#72008-sha1:26175bf)
----------
----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------
(unnamed)
(image/png, 1.1 KB) - not displayed
(unnamed)
(image/png, 468 B) - not displayed
(unnamed)
(image/png, 2.9 KB) - not displayed