Custom Module will not filter by Category

I have looked through the forum and didn’t see this issue posted. I am new to Treepl CMS so I am playing around as I prepare to move sites from BC and get familiar with Treepl CMS. I must be missing something.

I have a simple custom module that currently has two items in it. I also created two categories and assigned one of the items to a category. I added the following component tag…

{% component source: "Sculptures", layout: "List", filterBy: "ItemCategories", filterValue: "Catholic", emptyMessage: "No Listing", type: "module" %}

Filter by and Filter Value populated from the component selection option menu so I know my categories are there. This should work but it doesn’t.

The custom module item is assigned to the category. As the item data shows

“ItemCategories”: [ “Catholic” ],

This is the only data point that has [ ] around the data all the other just have " " around the data. Is this the reason it doesn’t work?

Example: “Height”: “7’”, “ItemCategories”: [ “Catholic” ],

Using {% component type: “categories” %} I can see both categories. So that works.

There is a disconnect somewhere and it may be me.

Yeah, I think this is a bug introduced in the last update as I ran into this issue yesterday (but haven’t had time to properly test).
It seems that the data is output - ie: if you push it to a collectionVariable, but it’s just not rendering the list layout for some reason.
@vlad.z

This has been a bug for several weeks. The work-around until it is fixed is to:

  1. Export the custom module items.
  2. Delete the Custom IDs (but not the column or its heading) in the spreadsheet.
  3. Delete all custom modules items via the admin area.
  4. Import the spreadsheet back into the custom module which will consider all those items as new because they don’t have a custom id and somehow the filter by categories will not work.
    If only a few items are not filtering by categories, I import just those items as ‘new’ after first deleting them from the custom module (if you don’t delete them, you’ll end up with duplicates).

Ya, I really, really, really need this bug fixed.

1 Like

@vlad.z any update on the filtering by category issue?
I thought this was due to the reindex issues, but these have been resolved in v5.0.1 haven’t they? yet filtering by category still isn’t working, or has a different issue.

Can you give me a link to a site where the issue occurs?
I can’t replicate it on my site so I need a live example in order to check it and provide a solution.
It may be a legacy-crashed index or item issue because new created items shown correctly.

Try this one https://sljstudio.trialsite.co. I have a custom module called Sculptures. On this page https://sljstudio.trialsite.co/catholic I have put together a demo so you can see it pulls all items in the module but when filtering by category nothing shows up. There should be two items there.

I’ve never had problems with new items that are imported. I problem I regularly encounter is with assigning a new category to an existing item.

Thanks @vlad.z. I’ve submitted a ticket with the site I’m having this issue with. Ticket [1312].

Have submitted my links from a migration: Ticket [1315] :slight_smile: Hope it helps.

We have found a solution. The fix will be provided in the current sprint release.

4 Likes

Looks like the Categories now work in Custom Modules.

However, I found a possible bug. Using a user-submitted custom module update form. When you change the category(s) the original category(s) are still in the data.

Here you can see it shows 4 categories in line two (Column labeled “Station”)


It should only show KRNP, KZTL.

When I look at the edit form on the front end it only shows KRNP, KZTL selected and when I look at it in the back end it only shows KRNP, KZTL selected. Shown below.

If I hit save in the backend the other categories go away and it works correctly. Something with the front end update form is not working correctly on categories.