Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

Error Message when changed optional field to mandatory for metadata schema.

Avatar

Level 3

Hi All,

   We have a Asset metadata schema with various fields , Many of them are optional. Now we are trying to make few fields as required, and expectation was it gives an error if any those mandatory fields are is not authored for new assets  . But it is showing a error message (REQUIRED METADATA IS MISSING) for the existing assets. Is there a way to not to display such error for the already existing assets ?

1476811_pastedImage_3.png

Thanks in Advance.

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi,

Not sure which AEM version you are talking about here, my reply assumes it is for 6.4 (though most of it will be applicable even for previous versions too).

-> expectation was it gives an error if any those mandatory fields are is not authored for new assets  .

For this definition of "new assets" needs to be shape out first, to keep it simple, I am considering assets which are ingested in last 24 hours are new assets.

-> Is there a way to not to display such error for the already existing assets ?

Yes. AFAIK there is no config to achieve this but you can overlay[0], there is a method with name hasValidMetadata at line no. 353. Just update the method and add condition to return true only for assets which are ingested(jcr:created) 24 hour before.

[0]/libs/dam/gui/coral/components/admin/contentrenderer/card/common/card-banner.jsp

View solution in original post

12 Replies

Avatar

Level 10

Can you show us which property you changed.

Avatar

Correct answer by
Level 4

Hi,

Not sure which AEM version you are talking about here, my reply assumes it is for 6.4 (though most of it will be applicable even for previous versions too).

-> expectation was it gives an error if any those mandatory fields are is not authored for new assets  .

For this definition of "new assets" needs to be shape out first, to keep it simple, I am considering assets which are ingested in last 24 hours are new assets.

-> Is there a way to not to display such error for the already existing assets ?

Yes. AFAIK there is no config to achieve this but you can overlay[0], there is a method with name hasValidMetadata at line no. 353. Just update the method and add condition to return true only for assets which are ingested(jcr:created) 24 hour before.

[0]/libs/dam/gui/coral/components/admin/contentrenderer/card/common/card-banner.jsp

Avatar

Level 3

Thanks a lot Ashu. Overlaying card-banner.jsp worked like a charm.
you can mark as correct answer.

Avatar

Level 3

Hi Ashu,

The approach which you have provided , works fine. But I see same error shows up if I am trying to use filters and options.
screenshot1.pngscreenshot2.pnghanks in Advance.

Avatar

Level 4

The cards rendered on Search Page has different code and including CardBanner using absolute URL. Please check the component at [2] Line no. 54

You should overlay this as well, and refer to /card-banner.jsp overlaid in /apps.

Considering you are asking this for AEM 6.3, since this has been fixed in 6.4.

[2]/libs/dam/gui/coral/components/admin/contentrenderer/card/assetomnisearch/assetomnisearch.jsp#L54

Avatar

Level 3

Thanks for reply Ashu. I forgot to mention AEM version , We are using 6.2.

Avatar

Level 4

Fine it will be Line #52 if AEM 6.2 + latest CFP.

/libs/dam/gui/coral/components/admin/contentrenderer/card/assetomnisearch/assetomnisearch.jsp#L52

Avatar

Level 3

I have overlayed /libs/dam/gui/coral/components/admin/contentrenderer/card/assetomnisearch/assetomnisearch. jsp and I have referred card-banner.jsp with the apps path . Still no luck. I am  still seeing the error on using filters.
I am on AEM 6.2 with CFP 14.


Regards,

pradeep.

Avatar

Level 4

Yes it may not work as I can see card's path is hardcoded to /libs at [1]. The "/libs/" should be removed from [1] to allow overlaying. You can log a product's enhancement request to get it done. Thanks

[1]/libs/granite/omnisearch/content/metadata/asset

Avatar

Level 3

Hi ashu4pma,

thanks for replying . I will create a day care ticket and will update here based on the response from adobe.

Avatar

Level 3

Hi ashu4pma,

                              Could you please respond to the following questions as well . If you can. Thanks in Advance.

Assets Search:
Auto-populate asset metadata schema

ashu4pma

Avatar

Level 4

Replied, both questions are bit open ended, expecting more details to converge. Thanks