Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

jcr:title being saved as String[] on changing and saving page properties; causes "Manage Publication" Touch UI dialog to break

Avatar

Level 5

We're seeing an issue with a few of our templates where if the page properties are edited (within Touch UI "Properties") after initial page creation, the jcr:title field property type will be changed from String to String[], the jcr:title field will then contain 2 identical jcr:title values (we see this in /crx/de). Whatever was there initially is repeated into a second value.

 

This then breaks the "Manage Publication" dialog within the Touch UI. The article for which one tries to "Manage Publication" cannot be selected in the dialog or added for publishing or unpublishing, it shows as a checkbox but no article is displayed in the listing, and when attempting to add the same article (via the button to add items within the "Manage Publication" dialog), it reports it cannot be added because it's already there, though it doesn't show up.

 

Changing jcr:title from String[] back to String by removing the property and re-adding it (in /crx/de) fixes the issue until the article's page properties might be edited again.


I've looked at related template code searching for any instance of String[] but only see one for an unrelated field (i.e. tags) which makes sense as multiple tags can be assigned.

 

Has anyone seen similar behavior with a property / field changing it's definition / type? Thanks for any info on how to debug and fix!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You are right. Setting typehint to String should fix it.

 

View solution in original post

10 Replies

Avatar

Community Advisor

@this-that-the-otter : This can happen if you have specified a typehint for your property or some specific type of field values.

Can you check if there is a @TypeHint set for jcr:title property (ideally should not be the case).
If not, can you share what kind of values are being set on title field.

thanks.

@Kamal_Kishor: Thank you for replying! I do see @TypeHint in related code but not for jcr:title. The @TypeHint looks to be used to set on/off time, whose fields, along with title, are present in the page "Properties" dialog. Here's a glimpse of how the jcr:title is mentioned in the component code which I believe is rendering the page "Properties" dialog: 

 

    <items jcr:primaryType="cq:WidgetCollection">
        <title
            jcr:primaryType="cq:Widget"
            fieldLabel="Title"
            name="./jcr:title"
            xtype="textfield"/>
        <shortTitle ...

 

further down in the same file ...

 

        <onofftime
            jcr:primaryType="cq:Widget"
            cls="cq-propsdialog-set-onofftime"
            collapsed="{Boolean}true"
            collapsible="{Boolean}true"
            hideMode="offsets"
            title="On/Off Time"
            xtype="dialogfieldset">
            <items jcr:primaryType="cq:WidgetCollection">
                <ontime
                    jcr:primaryType="cq:Widget"
                    ctCls="cq-propsdialog-ontime"
                    fieldLabel="On Time"
                    name="./onTime"
                    xtype="datetime"/>
                <offtime
                    jcr:primaryType="cq:Widget"
                    ctCls="cq-propsdialog-offtime"
                    fieldLabel="Off Time"
                    name="./offTime"
                    xtype="datetime"/>
                <onTimeHint
                    jcr:primaryType="cq:Widget"
                    ignoreData="{Boolean}true"
                    name="./onTime@TypeHint"
                    value="Date"
                    xtype="hidden"/>
                <offTimeHint
                    jcr:primaryType="cq:Widget"
                    ignoreData="{Boolean}true"
                    name="./offTime@TypeHint"
                    value="Date"
                    xtype="hidden"/>
            </items>
        </onofftime>
    </items>
</jcr:root>

 

Thanks again.

 

Avatar

Community Advisor

@this-that-the-otter : Ok, so TypeHint does not seem to be the issue here.
Can you please tell us how are you updating the title value and if this issue occurs only with specific type of values or with any title string value?
I am also wondering if you have any script/backend-code trying to update the title for your pages.
This looks bit odd since ideally this should not occur.

thank you.

Hi @Kamal_Kishor

It seems to happen no matter the values entered, e.g. simple 1 word strings like: TEST cause the issue. I am only updating manually via the page properties dialog when I see the issue.

I don't think there's any back end activity happening for the articles that are created using these templates, but I will check.

This problem only happens when page properties are edited. The url looks like: /mnt/overlay/wcm/core/content/sites/properties.html?item=

There are multiple tabs - I'm only ever on the default tab (it's called "Basic") there are others:

 

Basic
Advanced
Thumbnail
Cloud Services
Personalization
Permissions
News Release
News Image

 

The issue doesn't happen if I edit the article in the Touch UI page editor (but I cannot edit the page title there).

I created a new article, specified some values (title, short title, etc.) went to page properties, and deleted one of the fields specified when creating the page (short title I believe), after saving the change, jcr:title was again switched from String to String[] and had two titles in the array.

The issue will happen if I save page properties without making any changes. Interestingly, making multiple changes does not continue to duplicate jcr:title in the array, it seems to stop at 2.

Thanks.

Hi @Kamal_Kishor - do you have any other suggestions? 

Avatar

Community Advisor

@this-that-the-otter : If possible, can you please try your code on fresh local AEM instance and see if it still does the same? If it works properly on new instance, maybe something was changed on your instance which is still causing this issue.


Also, you can try to check if there is a code change which is explicitly making title property to be a multi-value field which is causing all these issues.

 

thanks.

Avatar

Level 5

Hi @Kamal_Kishor - 

 

Thank you for the suggestions. 

 

I see the same behavior on a fresh 6.5 instance - w/o service pack and with SP 6.5.22.

One interesting thing I see directly upon saving from page properties (to cause the issue) - in a log file:

 

aemxyz.log:2025-02-20 13:28:10.242 DEBUG [com.xyz.aemxyz.core.impl.listeners.XyzJcrEventListener] FOO: /content/xyz/en/about/data/test-6/jcr:content/jcr:title

aemxyz.log:2025-02-20 13:28:10.242 DEBUG [com.xyz.aemxyz.core.impl.listeners.XyzJcrEventListener] FOO: /content/xyz/en/about/data/test-6/jcr:content/cq:lastModified

aemxyz.log:2025-02-20 13:28:10.242 DEBUG [com.xyz.aemxyz.core.impl.listeners.XyzJcrEventListener] FOO: /content/xyz/en/about/data/test-6/jcr:content/page

 

Maybe I could try to disable this listener? I'll need to research how. The XyzJcrEventListener.java code has mentions of String[] -

but I'm not sure this listener is causing the issue or saving anything to the page that's being edited (via page properties to cause the issue).

 

Thanks.

Avatar

Community Advisor

@this-that-the-otter : Thanks for sharing this.

Please see if in your listener code, it is updating jcr:title property. If it is, you can try commenting it out and deploy it to your instance.

That should help narrow down on what is causing this String[] issue.

thanks.

Hi @Kamal_Kishor ; 

 

I removed the listener java/class it didn't change the behavior, I tried the template/component in different paths of the site (after changing allowedPaths), and saw the same behavior.

I asked Google Gemini: 

https://www.google.com/search?q=aem+property+changing+its+type+from+string+to+string+array

Answer:

When a property in AEM unexpectedly changes its type from String to String[], it usually occurs when the field associated with the property allows multiple values. If a user initially saves a single value, AEM creates a String property. However, upon saving multiple values, AEM automatically converts the property type to String[].
To handle this behavior, consider these approaches:
  • TypeHint: Utilize the @TypeHint suffix in the property name within the dialog to explicitly define the property type as String[]. This ensures that AEM always treats the property as a String array, even when only a single value is initially saved. For example:

 

 

    <myProperty jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/foundation/form/textfield"
                name="./myProperty"/>
    <myPropertyTypeHint jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/foundation/form/hidden"
                        name="./myProperty@TypeHint"
                        value="String[]"/>

 

 

There are two templates/components where we are seeing the issue. In both I made what seem like the same 2 changes: 

 

In _cq_dialog/.content.xml

From:

 

                                <items jcr:primaryType="nt:unstructured">
                                    <title
                                        jcr:primaryType="nt:unstructured"
                                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                        fieldLabel="Title"
                                        name="./jcr:title"/>
                                    <shortTitle ...

 

To:

 

                                <items jcr:primaryType="nt:unstructured">
                                    <title
                                        jcr:primaryType="nt:unstructured"
                                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                        fieldLabel="Title"
                                        name="./jcr:title@TypeHint"
					value="String"/>
                                    <shortTitle ...

 

 

And in the tabs_component.xml 

From:

 

        <title
            jcr:primaryType="cq:Widget"
            fieldLabel="Title"
            name="./jcr:title"
            xtype="textfield"/>
        <shortTitle ...

 

To:

 

        <title
            jcr:primaryType="cq:Widget"
            fieldLabel="Title"
            name="./jcr:title@TypeHint"
	    value="String"
            xtype="textfield"/>
        <shortTitle ...

 

 

This seems to completely fix the issue for one of our templates/components - but in the other, while jcr:title remains a String even after editing properties, and the Manage Publication dialog continues to work (even after editing properties), the word "String" shows up as a value in one of the Title fields? 

 

Thank you again for any help.

Avatar

Correct answer by
Community Advisor

You are right. Setting typehint to String should fix it.