Forum

Thread tagged as: Problem, Error, Runway

Collections/Categories Bug?

Hello,

Just wondering whether the following is a bug;

I've set up a Collection added a category line in the template

<perch:categories id="productType" label="Product Type" set="product-type" required="true" order="5" />

I select my categories save the collection, then I filter the collection by category:

<?php 
perch_collection('Products', array(
'category'=>'product-type/mobile-storage-charging',
));
?>

Great, this is filtering by the category, until one of the categories is removed from one of the collection items, the filter does not update.

Cleared all cache

Dexter Harrison

Dexter Harrison 14 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you mean it still appears in the list as if the category was still applied to it?

Hi Drew,

Yes that's right

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, that doesn't sound right, we'll have a look at it.

Hi again,

Just another note on this, the re-order does not update the list either

Found something else weird.

I just changed new items are "added to the top" and now when I add an item i get two new items, and if you try and delete one, it deletes them both.

I changed it back to "added to the bottom" but it still adds two.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Does 2.7.3 help with this?

Nope, just updated same issues

Drew McLellan

Drew McLellan 2638 points
Perch Support

When you say "the re-order does not update the list either" what do you mean?

Well if i do this (A normal multi item perch region)

<?php
     perch_content_custom('Case Studies', array(
        'template'   => 'Case_Studies/Case_Study-List.html',
      ));
?>

This will list them in the same order as in the Perch Admin so you can move them around to suit.

But if i do the same with a collection

<?php 
   perch_collection('Products');
?>

And re order them in the Perch Admin they stick to the order they were added

Drew McLellan

Drew McLellan 2638 points
Perch Support

I see - nothing to do with categories. That's where I was confused.

Yeah sorry.

It's all just on this one collection where I'm experiencing problems with the actual collection and the categories sorry I wasn't very clear

Just managed to recreate the issue with it adding two items on the collection.

It's nothing to do with the new items are added to top/bottom that was just a coincidence.

It happens when you delete an item.

Drew McLellan

Drew McLellan 2638 points
Perch Support

So does the category problem still persist?

Yes it does.

List of my problems:

  1. When removing a category from an item, the item still displays under the filter as if it still has the category applied
  2. Re-ordering items within perch admin does not update the list
  3. After deleting a collection item i get a bug where it adds two items at once
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, we'll take another look at it.