Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

pradeepb6049780
Level 3
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
ashu4pma
Correct answer by
Level 4
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
smacdonald2008
Level 10
Level 10

Can you show us which property you changed.

ashu4pma
Correct answer by
Level 4
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

pradeepb6049780
Level 3
Level 3

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

pradeepb6049780
Level 3
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.

ashu4pma
Level 4
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

pradeepb6049780
Level 3
Level 3

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

ashu4pma
Level 4
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

pradeepb6049780
Level 3
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.

ashu4pma
Level 4
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

pradeepb6049780
Level 3
Level 3

Hi ashu4pma,

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

pradeepb6049780
Level 3
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

ashu4pma
Level 4
Level 4

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