Message Boards

[Liferay 7.3] Asset publisher cannot filter by category

Darryl Kpizingui, modified 4 Years ago.

[Liferay 7.3] Asset publisher cannot filter by category

Junior Member Posts: 82 Join Date: 1/10/13 Recent Posts
Hi,

It would be good to have the Liferay technical team input about that.
I am migrating a portal from Liferay 6.2 to 7.3.

On a page I have an asset publisher. It is displayed on the page but the content displayed is ignoring the categogy we have in the preferences.
As It is urgent, I looked into the source code and I think I find where the issue comes from and the set of github commit associated.
I create another service that it is able to make the asset publisher filter the content with the proper category.

The class that seems to cause the issue is : AssetPublisherHelperImpl in the project asset-publisher-web.
The set of commits are related to the commit : https://github.com/liferay/liferay-portal/commit/221dba9837a5b95da198883baa6013a0e6e8e8c9

The code bellow seems to always provide filteredCategoryIds empty as the two lists contains the same items.


long[] filteredCategoryIds = ArrayUtil.filter(
portletPreferencesCategoryIds,
categoryId -> !ArrayUtil.contains(allCategoryIds, categoryId));



Cheers,
Darryl.
Darryl Kpizingui, modified 4 Years ago.

RE: [Liferay 7.3] Asset publisher cannot filter by category

Junior Member Posts: 82 Join Date: 1/10/13 Recent Posts
Hi,

I was able to find and solve the real issue. The root cause was that the migration removed some data when it trying to recreate the table after dumping the content in a file and recreate it back. The errors can be found in the migration log, in the form:

Attempting to upgrade table XXXXX by recreating the table due to: ...


When Liferay dump the table to file and recreate the whole thing many data are missing. Later in the portal I found issue with Assets, Layout, Web content and so on. So make sure you create the missing columns before running the migration tool. This prevent Liferay from dumping the database to a file.

Cheers,
Darryl.
thumbnail
Alberto Chaparro Terleira, modified 4 Years ago.

RE: [Liferay 7.3] Asset publisher cannot filter by category

Liferay Master Posts: 549 Join Date: 4/25/11 Recent Posts
Hi Darryl,
Can you detail which fields you had to add before the upgrade? This shouldn't be happening, this means that the table recreation process fails sometimes. We would like to fix this as soon as possible.

Apart from that, we were recreating the table more times than needed, this has been solved here:https://issues.liferay.com/browse/LPS-110703

Thanks for the collaboration.Best regards.
Darryl Kpizingui, modified 4 Years ago.

RE: [Liferay 7.3] Asset publisher cannot filter by category

Junior Member Posts: 82 Join Date: 1/10/13 Recent Posts
Hi Alberto,

Here are some of the changes I added in the postgres BD. I think I also had the status column in the table "layout".


ALTER TABLE AssetCategory add column treepath text;
ALTER TABLE layout ADD COLUMN masterlayoutplid bigint DEFAULT(0);
ALTER TABLE journalarticle ADD COLUMN ctcollectionid bigint NOT NULL DEFAULT(0);
ALTER TABLE layout ADD COLUMN status integer;


I did not do change for the ratings (or others with the same warnings) table as we do not use it.

Cheers,
Darryl.
thumbnail
Alberto Chaparro Terleira, modified 3 Years ago.

RE: [Liferay 7.3] Asset publisher cannot filter by category

Liferay Master Posts: 549 Join Date: 4/25/11 Recent Posts
Hi Darryl,
Thank so much for the provided information. After checking the case, I think the recreation of the table won't be thrown for these cases anymore because of https://issues.liferay.com/browse/LPS-110703
Anyway, we will invest some time this week and next one to see if there is an error in the recreation process as you have pointed out. I will update this thread with the findings.
Thanks again and have a good week.