Forum

Thread tagged as: Problem, Error

Duplicate items in "multiple item" region

Hi,

This is a bit of a weird one. My website features a "Profiles" region. This is a standard region (image, text, dataselect fields) with no repeaters.

This has around 100 items. For some reason, when we last added a new item, the CMS created duplicates of all of these items. When I looked into it a bit more, I could see that each duplicate had the exact same item ID as the original (and when viewing each item, the item showed 2 copies of each field).

If I delete each duplicate, then each item goes back to having 1 copy of each field - I just don't understand how this could have happened...

Perch isn't fully up to date, but I'm running 3.0.8 (so fairly up to date). I'm also running PHP 7.0.10 if it helps.

Any help/suggestions/feedback of known issues would be a huge help!

Matthew Lymer

Matthew Lymer 1 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It sounds like that region is a bit overloaded and your server is struggling to keep up. Have you considered switching to Runway? Collections are designed to handle those bigger volumes of content.

Drastic rebuilding isn't going to be an option for the client unfortunately. Also, I'm running quite a few other websites with equally bigger (if not larger) multiple item regions on the same server (which is fairly bulky, and never really exceeds 20% capacity for processing/memory), none of which have seen this issue before.

Just wondered if it is something you had come across before - as it's not really that it can't cope, but under intermittent and unexplained circumstances, it duplicates content.

Drew McLellan

Drew McLellan 2638 points
Perch Support

I've only ever seen it with overloaded regions. They were never designed for 100s of items.

I see - do you have any idea of how many items a region should be able to cope with? As this one has approximately 98.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It very much depends on how much content is involved and the performance of the server.

With a region, any edit re-saves the entire region. That involves creating a new revision, reindexing and republishing all the content for every item in that region. That's no problem for a handful of items, but will get slow when you're dealing with tens or hundreds of items, and if you exceed the available memory or configured limits, there's a risk the process can exit uncleanly, creating a mess.

Usually when that happens, clicking Undo should put it back to the previous revision.

This happens because Perch is designed and optimised for small sites. If you have hundreds of items of content in a single region, that's outside the scope of the design. That's where Runway and Collections come in. Collections are similar in concept to multiple item regions, except every item within a collection is independent. Editing one item only revises that one item.

Your drastic rebuild involves:

  1. Upgrading to Runway
  2. Creating a new collection, selecting your existing region to import
  3. Changing your perch_content() function calls for that region to perch_collection().

Big help Drew. Didn't realise the upgrade and recreation of items as collections would be so simple!