Skip to Content
0
Jan 19, 2021 at 04:24 PM

Custom Media field cannot be updated using SmartEdit editor

142 Views

Hi,

I am updating a SAP Commerce v.1808 so SmartEdit can be used. I have a custom cmsComponent with an attribute called "backgroundImage".

myextension-items.xml:

<itemtype code="MyCMSElement" extends="SimpleCMSComponent" jaloclass="...">
    <description>My custom component</description>
    <attributes>
        ....
        <attribute qualifier="backgroundImage" type="localized:CMSMedia">
            <persistence type="property"/>
            <description>Holds the media for the background of the element</description>
        </attribute>
    </attributes>
</itemtype>

In the SmartEdit component editor I can see and interact with such field after I added the populator to my spring.xml file.

myextension-spring.xml:

<bean class="de.hybris.platform.cmsfacades.types.service.impl.DefaultComponentTypeAttributeStructure" p:typecode="MyCMSElement" p:qualifier="backgroundImage">
    <property name="populators">
        <set>
            <ref bean="mediaComponentTypeAttributePopulator" />
        </set>
    </property>
</bean> 


Smartedit:

However, the field appears empty in every language, as if not media is selected yet (while in backoffice I can see it is correctly filled). I can select a new media in SmartEdit and save the editor and apparently it works and no errors are shown, but the new media is not being stored in the field.

Backoffice:

Any ideas of what I'm missing? I'm following the documentation about creating a custom component so it can be used in SmartEdit but I cannot find what I'm lacking.

Thanks in advance.