Skip to content

Commit

Permalink
Merge pull request #739 from City-of-Helsinki/UHF-9932
Browse files Browse the repository at this point in the history
UHF-9932: Additional checks to prevent notices/errors
  • Loading branch information
rpnykanen authored Apr 9, 2024
2 parents 54b0312 + e5719a6 commit ffe4c5e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/helfi_ckeditor/helfi_ckeditor.module
Original file line number Diff line number Diff line change
Expand Up @@ -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']
);
Expand Down

0 comments on commit ffe4c5e

Please sign in to comment.