Merge pull request #7793 from artoscinote/ma_SCI_10970

Don't fail report if a TinyMCE image variant fails to generate [SCI-10970]
This commit is contained in:
Martin Artnik 2024-08-12 12:31:57 +02:00 committed by GitHub
commit 0b059899b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,6 +29,7 @@ module TinyMceImages
)[0]
next unless tm_asset_to_update
begin
variant = tm_asset.image.variant(resize_to_limit: Constants::LARGE_PIC_FORMAT)
resized_asset = ActiveStorage::Variant.new(variant.blob, variant.variation).processed
@ -42,6 +43,10 @@ module TinyMceImages
end
tm_asset_to_update.attributes['src'].value = convert_to_base64(resized_asset)
rescue StandardError => e
Rails.logger.error(e)
end
description = html_description.css('body').inner_html.to_s
end
description