Thursday, February 5, 2015

Liferay 6.2 - Post-Migration issues

Liferay 6.2 - issues, which may occur after Liferay migration (from 5.x, 6.x to 6.2)


1. Document Library links issue.

After migration to 6.2 download links to DL documents may be broken (even if those document are displayed in DL portlet, and there are appropriate files in data/document_library folder).

This issue and it's fix described here: DL broken link issue


2. Dockbar issue - Add, Edit buttons do not work.

Description:

For some communities in Liferay 6.2  'Add', 'Edit' buttons in dockbar may display empty content. So, it's not possible to add portlet on page or modify page settings.

There can be also such error in browser:

Chrome: Uncaught TypeError: Cannot read property 'ancestor' of null
Firefox: TypeError: a.one(...) is null

There is also similar LPS issue: https://issues.liferay.com/browse/LPS-38040

Fix:

At first sight, it seems to be a JS error.
But the issue may be in DB corrupted data. 

1) Check groupId for current community,  and get creatorUserId for that group_; 
2) Check if such user exists;
3) If there is no such user, change creatorUserId for that group_ for existing user (e.g. admin);
4) Clean DB cache;
5) Check if issue resolved;
6) Check if there are other communities with corrupted data:

SELECT creatorUserId, groupId, friendlyURL from group_ WHERE creatorUserId not in (SELECT userId from user_);
7) If there are such records - change creatorUserId for them also.


Wednesday, February 4, 2015

Liferay 6.2 - Unable to download DL documents


Liferay 6.2 - Unable to download DL documents

________________________________________________________________________________
Description:

Documents are available in DL, and there are appropriate files in /data/document_library folder, but download link is broken. When accessing link, like:

http://domain.com/documents/279794/304265/doc.xml/29d62ab3-c587-4a4e-9346-f9c9388430a2

such error is shown:


However, when accessing the same document using host:port URL, like:

http://host:port/documents/279794/304265/doc.xml/29d62ab3-c587-4a4e-9346-f9c9388430a2

files are downloaded successfully.


________________________________________________________________________________
Fix:

Patch com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter class:

(line 290):
/*forwardURL.append(_PRIVATE_GROUP_SERVLET_MAPPING);*/
/*patch:*/
if (isDocumentFriendlyURL(
        request, group.getGroupId(), friendlyURL)) {

    processFilter(
            VirtualHostFilter.class, request, response,
            filterChain);

    return;
}
else {
    forwardURL.append(_PRIVATE_GROUP_SERVLET_MAPPING);
}
/*patch:*/


Compile it, and place into /ROOT/WEB-INF/classes directory. Restart Liferay.
________________________________________________________________________________
More info:

1. Jira issue
2. Liferay form thread