cancel
Showing results for 
Search instead for 
Did you mean: 

smart edit can't add new item to custom component

Former Member

I want to add a new item from smart edit to my custom component but when I save the changes the item disappears. The item was created beacause I can add it from backoffice but not from smart edit. I try the same in other projects and it works successfully, maybe, because the components are OOTB and mine is customized.

I can't remove any item neither. The same thing happens,it seems like it works but when I save the changes there are no changes

There are no errors in terminal and we're using Hybris 18.08

Any suggestion?

Accepted Solutions (0)

Answers (1)

Answers (1)

Hi ,

The issue probably exists due to cmsfacades used by SmartEdit are unaware of how to convert your custom item. I would propose to debug a bit starting from de.hybris.platform.cmsfacades.cmsitems.impl.DefaultCMSItemFacade#saveItem

Probably the issue exists due to de.hybris.platform.cmsfacades.uniqueidentifier.UniqueItemIdentifierService can't convert your item from data to model and vice versa. Please take a look at de.hybris.platform.cmsfacades.uniqueidentifier.UniqueIdentifierConverter and implement a brand new one for your custom itemtype to be used in component. Hope this helps.

Regards, Mykola

Former Member
0 Kudos

Hi Mykola, Thank you for your comment, we found the problem. The problem was the relation, we changed collentionType = "set" to ordered = "true" and it worked

 <sourceElement type="SimpleCMSComponent" qualifier="component" cardinality="one"/>
             <targetElement type="customComponent2items" qualifier="items" cardinality="many" collectionType="set"/>
         </relation>
 
             <sourceElement type="SimpleCMSComponent" qualifier="component" cardinality="one"/>
             <targetElement type="customComponent2items" qualifier="items" cardinality="many" ordered="true"/>
         </relation>

Regards, Andrea