Skip to content

Commit

Permalink
UHF-9932: Must check if the required is set and is array before anyth…
Browse files Browse the repository at this point in the history
…ing happens. Also make sure the revering is not done when language is ltr
  • Loading branch information
rpnykanen committed Apr 9, 2024
1 parent 41a9cbd commit e5719a6
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 e5719a6

Please sign in to comment.