diff --git a/modules/helfi_ckeditor/helfi_ckeditor.module b/modules/helfi_ckeditor/helfi_ckeditor.module index f7c5bb120..3a7bffe38 100644 --- a/modules/helfi_ckeditor/helfi_ckeditor.module +++ b/modules/helfi_ckeditor/helfi_ckeditor.module @@ -57,7 +57,12 @@ function helfi_ckeditor_js_settings_alter(array &$settings) { foreach ($settings['editor']['formats'] as $name => $array) { $settings['editor']['formats'][$name]['editorSettings']['language']['ui'] = $language_id; - if ($ui_language_direction === 'ltr') { + if ( + $ui_language_direction === 'ltr' && + $content_language->getDirection() == 'rtl' && + isset($settings['editor']['formats'][$name]['editorSettings']['toolbar']['items']) && + is_array($settings['editor']['formats'][$name]['editorSettings']['toolbar']['items']) + ) { $settings['editor']['formats'][$name]['editorSettings']['toolbar']['items'] = array_reverse( $settings['editor']['formats'][$name]['editorSettings']['toolbar']['items'] );