Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Faced an error when saving tag fields an image property after applying the AEM 6.5.13 update package.

Avatar

Level 3

Hello.

I ran into a problem that after accepting the 6.5.13 service pack, I encounter an error when saving changes to the tags in the image properties.

aliaksandr_hvoz_0-1661958681156.png

 

After research, I found that a change was made to the render for the field tag.

In AEM SP 6.5.12

for (String value : values) {
            com.day.cq.tagging.Tag cqTag = tagManager.resolve(value);

            String text;
            if (cqTag != null) {
                text = cqTag.getTitlePath(request.getLocale());
                %><coral-tag multiline value="<%= xssAPI.encodeForHTMLAttr(value) %>"><%= xssAPI.encodeForHTML(text) %></coral-tag><%
            }
        }

In AEM SP 6.5.13

for (String value : values) {
            com.day.cq.tagging.Tag cqTag = tagManager.resolve(value);

            String text;
            if (cqTag != null) {
                text = cqTag.getTitlePath(request.getLocale());
                %><coral-tag multiline value="<%= xssAPI.encodeForHTMLAttr(value) %>"><%= xssAPI.encodeForHTML(text) %></coral-tag><%
            } else {
                %><coral-tag multiline value="<%= xssAPI.encodeForHTMLAttr(value) %>" style="display:none;"></coral-tag><%
            }
        }

I use tag:

<someTag
                                    cq:showOnCreate="{Boolean}true"
                                    jcr:primaryType="nt:unstructured"
                                    sling:resourceType="cq/gui/components/coral/common/form/tagfield"
                                    fieldLabel="Some Tag"
                                    metaType="tags"
                                    allowCreate="{Boolean}true"
                                    cq-msm-lockable="cq:tags"
                                    multiple="{Boolean}false"
                                    name="./jcr:content/metadata/someTags"
                                    rootPath="/etc/tags/SomeTags"/>

 

Can you please tell me how to fix this situation besides override render.jsp in tag field by path /libs/cq/gui/components/coral/common/form/tagfield/render.jsp?

 

Thank you.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Please check "Map to property" field in Schema of that property. It should be something like ./jcr:content/metadata/propertyName.

sachinarora_0-1662037056704.png

 

View solution in original post

7 Replies

Avatar

Community Advisor

Please confirm by Image properties you mean Asset Properties? 

I tried same in 6.5.13 on one of the we-retail Assets and I am not facing this issue.

sachinarora_0-1662001828231.png

 

Avatar

Community Advisor

I updated schema to add a new tag field and that too is working fine. Please try in vanilla instance once, it should work fine.

sachinarora_0-1662022854918.png

 

Avatar

Level 3

We use several environments and on some, we encountered this error and on others, we didn't. But on all these environments the same code is used.

Avatar

Community Advisor

In that case it should not be an issue due to upgrade to 6.5.13. Please check what exactly is the difference on environment which is causing the issue. Seeing the pop up error, issue looks more of a user permissions.

Avatar

Level 3

This message appears due to the fact that the entered data is created under /etc/tags and not in the image metadata under /jcr:content. With the rights everything is fine, I'm as an administrator.

Avatar

Correct answer by
Community Advisor

Please check "Map to property" field in Schema of that property. It should be something like ./jcr:content/metadata/propertyName.

sachinarora_0-1662037056704.png