Skip to content

Commit

Permalink
IBX-7954: Show error message on empty image asset (#2116)
Browse files Browse the repository at this point in the history
  • Loading branch information
barw4 authored Mar 26, 2024
1 parent 80eeb14 commit 2ffae96
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/bundle/Resources/public/js/scripts/fieldType/ezimageasset.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@
return field.fieldDefinitionIdentifier === imageAssetMapping['contentFieldIdentifier'];
});

if (imageField.fieldValue === null) {
showErrorNotification(
Translator.trans(
/* @Desc("The chosen asset has no image data available.") */ 'ezimageasset.empty_data.message.error',
{},
'fieldtypes_preview'
)
);

return;
}

this.updateData(
response.ContentInfo.Content._id,
response.ContentInfo.Content.TranslatedName,
Expand Down
5 changes: 5 additions & 0 deletions src/bundle/Resources/translations/fieldtypes_preview.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@
<target state="new">Alternative text</target>
<note>key: ezimageasset.alternative_text</note>
</trans-unit>
<trans-unit id="75c1175bca5f2a2334ffe321afdaedf7fa6887bd" resname="ezimageasset.empty_data.message.error">
<source>The chosen asset has no image data available.</source>
<target state="new">The chosen asset has no image data available.</target>
<note>key: ezimageasset.empty_data.message.error</note>
</trans-unit>
<trans-unit id="6ccdfa3f93ea5a6c0c17a7a9f6fe8fac4d5b6926" resname="ezimageasset.file_name">
<source>File name</source>
<target state="new">File name</target>
Expand Down

0 comments on commit 2ffae96

Please sign in to comment.