Skip to content
Snippets Groups Projects
Commit a9fea7fa authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #3367501: Fix Error When Using Vartheme Claro 3.0.x on Drupal 10

parent b179ca84
No related branches found
No related tags found
No related merge requests found
......@@ -47,3 +47,38 @@ function vartheme_claro_preprocess_install_page(&$variables) {
// Attach install page library.
$variables['#attached']['library'][] = $profile_name . '/install_page';
}
/**
* Implements hook_library_info_alter().
*/
function vartheme_claro_library_info_alter(&$libraries, $extension) {
if ($extension === 'ckeditor'
&& version_compare(Drupal::VERSION, '10.0.0', '<')
&& \Drupal::service('theme_handler')->themeExists('claro')) {
// Extend claro/ckeditor-editor with the ckeditor/drupal.ckeditor library.
if (isset($libraries['ckeditor/drupal.ckeditor'])) {
$libraries['ckeditor/drupal.ckeditor']['dependencies'][] = 'claro/ckeditor-editor';
}
// Extend ckeditor/drupal.ckeditor.admin with the claro/ckeditor-admin library.
if (isset($libraries['ckeditor/drupal.ckeditor.admin'])) {
$libraries['ckeditor/drupal.ckeditor.admin']['dependencies'][] = 'claro/ckeditor-admin';
}
// Extend ckeditor/ckeditor with the claro/ckeditor-dialog library.
if (isset($libraries['ckeditor/ckeditor'])) {
$libraries['ckeditor/ckeditor']['dependencies'][] = 'claro/ckeditor-dialog';
}
}
if ($extension === 'core'
&& version_compare(Drupal::VERSION, '10.0.0', '<')
&& \Drupal::service('theme_handler')->themeExists('claro')) {
// Extend core/ckeditor with the claro/ckeditor-dialog library.
if (isset($libraries['core/ckeditor'])) {
$libraries['core/ckeditor']['dependencies'][] = 'claro/ckeditor-dialog';
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment