Duplicate items in dropdown


#1

Enonic version: 6.15.4
OS: Linux

Hi guys, I would like to check a situation on site we are working. The customer is inserting content in dropdown and sometime the content is being duplicated in dropdown. The site is in Enonic cloud and the Enonic version is 6.15.4.

The image 1) is the dropdown in the content. The image 2) is the content in content viewer app. The content “b9106bcf-a5a2-4814-96d0-c9ad848b0690” is duplicated and whe we look on frontend (image 3) the content is shown as duplicated.

The customer has a lot of contents on site and that is happening several times and aleatory. I can avoid that by doing changes in the code, but I’m not sure if it is a problem in Enonic. If we remove all content in dropdown and insert the same content again, it usually fixes that problem.

Thanks!


#2

So, to understand this better, what you have is a input type of ContentSelector. When the end-user selects things here (shown in image 1) some of the items sometimes appear in the data (image 2) in a way not shown in the admin interface (image 1). Right?

Could you post the XML only for this ContentSelector? I’m assuming it uses maximum="0" minimum="0"?


#3

Also, since the data in XP is stored in a way that is disconnected from the actual schema definitions (the XML), changes to this XML will never affect the stored data, meaning you can end up with a lot of data stored but not shown in admin if you edit the XML a lot.


#4

Yes, it is a ContentSelector and it uses maximum=“0” minimum=“0”. This ContentSelector is in a mixin. The main problem is that we have 4 selected content in admin interface, but when we look the JSON by Content Viewer app, we have 5 selected content. So, some content is being duplicated in ContentSelector.


#5

Hi

We also need content-type called “location” and whatever content type is the one with option-set (based on your screenshots content selector is inside option-set).

On a side note, I tried to reproduce it with our own content-types but didn’t manage. Tried selecting/unselecting items in the content selector, changing order of selected items etc. - items are never duplicated after save. I also see that you wrote that it duplicates “sometimes”. Can you note the pattern when it happens? Because for example the second content selector inside your content JSON - selected items are not duplicated there. Which proves that it happens only under certain circumstances.