aem-core-wcm-components icon indicating copy to clipboard operation
aem-core-wcm-components copied to clipboard

Download asset title/description not used if directly dropped onto component

Open HitmanInWis opened this issue 1 year ago • 0 comments

Bug present as of version: 2.24.7-SNAPSHOT

When you add an asset to the Download component from the dialog, both "Get title from DAM asset" and "Get description from DAM asset" are defaulted to checked (i.e. enabled). However, if you use the cq:editConfig dropTargets capability to drag an asset from the sidebar onto the Download component from the standard page editor screen, those two options are not enabled, nor are they turned on when you open the dialog.

To fix this discrepancy, simply update the _cq_editConfig.xml from:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:primaryType="cq:EditConfig">
    <cq:dropTargets jcr:primaryType="nt:unstructured">
        <file
            jcr:primaryType="cq:DropTargetConfig"
            accept="[.*]"
            groups="[media]"
            propertyName="./fileReference"/>
    </cq:dropTargets>
</jcr:root>

to:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:primaryType="cq:EditConfig">
    <cq:dropTargets jcr:primaryType="nt:unstructured">
        <file
            jcr:primaryType="cq:DropTargetConfig"
            accept="[.*]"
            groups="[media]"
            propertyName="./fileReference">
            <parameters
                jcr:primaryType="nt:unstructured"
                titleFromAsset="true"
                descriptionFromAsset="true"/>
        </file>
    </cq:dropTargets>
</jcr:root>

HitmanInWis avatar May 07 '24 22:05 HitmanInWis