- Issue created by @hablat
- Merge request !13Issue #3484766: Re-sizing breaks after initial save or preview β (Open) created by hablat
- πΊπΈUnited States hablat
Added a possible fix as an MR. If others could please test. Thanks
- πΊπΈUnited States damondt
I appreciate the work on this, wysiwyg image resizing is fundamental to content editing.
That said this patch did not work when I tested, looking at the patch the
$node->setAttribute
call changing thedata-view-mode
attribute is negated by a following change of that attribute. Changing the order also didn't get it working for me though. - πΊπΈUnited States hablat
@damondt The only place I can see it being set somewhere else is here
if ($apply_image_styles) { $view_mode = $this->getViewModeByWidth($width, $ckeditor5_plugin_config); if ($view_mode) { $node->setAttribute('data-view-mode', $view_mode); } }
But that code only runs when your not in the editor because $apply_image_styles is only set to true outside of the editor
// Apply image styles only if the corresponding setting in the text format // configuration is enabled and if the filter is NOT processing during the // loading of the text inside the ckeditor. $apply_image_styles = !empty($ckeditor5_plugin_config['apply_image_styles']) && !$processing_in_editor;
Make sure you have the filtering order is set correctly for the text format your using. The Resize media images filter needs to run before the Embed media filter.