留言板

Managing pages results in a permanent error sooner or later

thumbnail
Michele Zanarotti,修改在9 年前。

Managing pages results in a permanent error sooner or later

Junior Member 帖子: 94 加入日期: 12-2-20 最近的帖子
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,修改在9 年前。

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

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在9 年前。

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

Junior Member 帖子: 94 加入日期: 12-2-20 最近的帖子
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,修改在9 年前。

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

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在9 年前。

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

Junior Member 帖子: 94 加入日期: 12-2-20 最近的帖子
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,修改在9 年前。

RE: Managing pages results in a permanent error sooner or later (答复)

Junior Member 帖子: 94 加入日期: 12-2-20 最近的帖子
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.