[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 ticket).
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
}
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.'
}
{code}

As to a way to reproduce the inconsistent situation originally reported I did this
- first step: install magnolia 5.4.3 EE (STK 2.9.2) w/o site-app
- second step: upgrade to 5.4.4 (STK 2.9.3) still w/o site-app
- third step:
-- 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.