Forums de discussion

Managing pages results in a permanent error sooner or later

thumbnail
Michele Zanarotti, modifié il y a 9 années.

Managing pages results in a permanent error sooner or later

Junior Member Publications: 94 Date d'inscription: 20/02/12 Publications récentes
I'm referring to https://issues.liferay.com/browse/LPS-43312 on Liferay 6.2 CE GA1

It seems that under some conditions a page remains visible but you can't edit it anymore, because of the 'String index -1 out of range' Exception.

Any workaround on that ? It's possible to fix the error after it happened ?
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Managing pages results in a permanent error sooner or later

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
These kinds of things are usually caused by code that assumes previous calls were successful, and are fixed by adding some defensive coding around the block that failed. Note that I haven't looked at the code so this is merely conjecture on my part.

Is it possible to fix after it happens? Well, probably not. If it is occurring in the middle of some activity Liferay is doing, and Liferay bails out of completing the processing, if you wait until some sort of outer try/catch block you're going to catch the exception but all of the processing Liferay was doing would have been skipped.
thumbnail
Michele Zanarotti, modifié il y a 9 années.

RE: Managing pages results in a permanent error sooner or later

Junior Member Publications: 94 Date d'inscription: 20/02/12 Publications récentes
I meant if it's possible to fix it after this happened at least once, so if there is a procedure to fix the database in order to clean something messy, once and for all.
I'm pretty sure something in the DB was written in a wrong way for some reason.
I can't restore previous db backups, probably this bug was going on for one week or two.

With all the portal additions I made so far, reverting back is the last resort I would think of.
thumbnail
David H Nebinger, modifié il y a 9 années.

RE: Managing pages results in a permanent error sooner or later

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
it just seems to be tied to the single welcome page, so there's not a lot that you need to do to resolve. I'd try rolling the default language back to english and renaming the welcome page back to welcome.
thumbnail
Michele Zanarotti, modifié il y a 9 années.

RE: Managing pages results in a permanent error sooner or later

Junior Member Publications: 94 Date d'inscription: 20/02/12 Publications récentes
I did this:

Site Settings -> Display Setting -> I set the Default language to English UK -> Save

Still I can't access the page settings of 'Home Page' (the page doesn't appear). As before.
So I cannot change the page name to solve the problem. Did you mean I have to change the page name in the db ?
thumbnail
Michele Zanarotti, modifié il y a 9 années.

RE: Managing pages results in a permanent error sooner or later (Réponse)

Junior Member Publications: 94 Date d'inscription: 20/02/12 Publications récentes
I solved doing this :

Server Admin -> Scripts -> Groovy


//finding the layout via plid 
def ls = com.liferay.portal.service.LayoutLocalServiceUtil.getLayout(10421)
//setting the new friendly url (on DB is currently missing)
ls.friendlyURL = "/home"
//update
com.liferay.portal.service.LayoutLocalServiceUtil.updateLayout(ls)


and press 'Execute'

It seems that everything is solved for this page from now, even when renaming it.