- Issue created by @jjgw
- ๐บ๐ธUnited States cilefen
If there are steps to reproduce this is a bug report.
That's a TypeError. Does Drupal crash when you save the configuration form?
- Status changed to Postponed: needs info
9 months ago 9:42am 27 September 2023 - ๐ง๐ชBelgium Wim Leers Ghent ๐ง๐ช๐ช๐บ
That is most likely caused by a Drupal contrib module. Can you please export your
core.extension
config and upload it here? Which of your installed modules provide CKEditor 5 plugins?Which version of Drupal core are you using?
P.S.: the screenshot is not visible, I have to accept some weird terms of service (which I won't do). Please upload images here.
- ๐ง๐ชBelgium jjgw
There is no bug involved here, but my database is corrupted. In fact, I had a power failure and I am now experiencing similar problems in other modules, like blocks. To avoid further surprises I am forced to redo my work of the last 3 days. Sorry voor het storen.
- ๐ง๐ชBelgium jjgw
my configuration:
Drupal 10.1.4
Apache 2.4.57 Ubuntu
PHP 8.2.10
Mysql 8.0.34.0 Ubuntu 22.04.1I did following tests on localhost:
1ยฐ install drupal with spanish translation
composer create-project drupal/recommended-project
2ยฐ check all text formats for basic page
goto /admin/structure/types/manage/page/fields/node.page.body
check all text formats and save
3ยฐ try to modify formats for Full HTML
goto /admin/config/content/formats
select full HTML
click on configure
4ยฐ result:
No icons are visible. Instead there are the text references to the icons.This time I have no more the error message as mentioned above.
What's weird:
I did this test 3 times with the same result.
I also did the same test with a non translated installation. (English)
And here the icons for full HTML are visible as expected!!! - ๐ง๐ชBelgium jjgw
On http://es.localhost/admin/config/content/formats/manage/basic_html?desti...
that's the clean spanish site without any content and contrib modules
I have no js errors but 2 (same) warnings:
[Deprecation] The keyword 'push-button' specified to an 'appearance' property is not standardized. It will be removed in the future.
I added all the available buttons, except the source button, to the active toolbar without getting js errors.
When I added the source button and saved the configuration, the buttons dissapear and are replaced by text, and I get 6 js errors + the 2 warnings. - ๐ง๐ชBelgium Wim Leers Ghent ๐ง๐ช๐ช๐บ
Please upload the screenshots here. That link will stop working at some point. And it already doesn't allow me to view the screenshots! ๐
[Deprecation] The keyword 'push-button' specified to an 'appearance' property is not standardized. It will be removed in the future.
This appears to be a warning from your browser about some CSS. It's not a JS error, fortunately ๐
- ๐ง๐ชBelgium jjgw
I thought uploading on this forum was not possible. It took me a while to find the right button.
- ๐ง๐ชBelgium Wim Leers Ghent ๐ง๐ช๐ช๐บ
Those errors imply
drupal.js
never loaded. ๐คฏThat's definitely not related to CKEditor 5.
Without steps to reproduce, there's absolutely nothing I can do to help you, @jjgw ๐
- ๐ช๐ธSpain slajo
Same error on a Drupal 10.1.6 default installation profile. Site default language Spanish.
I couldn`t reproduce this problem on a english (en) or portugรชs (pt-pt) sites.
When you try to change the format text editor to none you have this error stack:TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in in_array() (line 659 of core/modules/ckeditor5/ckeditor5.module).
ckeditor5_editor_presave(Object)
call_user_func_array(Object, Array) (Line: 409)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object, 'ckeditor5') (Line: 388)
Drupal\Core\Extension\ModuleHandler->invokeAllWith('editor_presave', Object) (Line: 416)
Drupal\Core\Extension\ModuleHandler->invokeAll('editor_presave', Array) (Line: 341)
Drupal\Core\Config\Entity\ConfigEntityStorage->invokeHook('presave', Object) (Line: 529)
Drupal\Core\Entity\EntityStorageBase->doPreSave(Object) (Line: 483)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 257)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 609)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 255)
editor_form_filter_admin_format_submit(Array, Object)
call_user_func_array('editor_form_filter_admin_format_submit', Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('filter_format_edit_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)If you add other languaje to the site (e.g english) you can change to that new language and edit de ckeditor ckeditor5-toolbar-configuration fieldset with no error.
The error only apear if de sourceEditing plugin is enabled.
No errors or warnings on Xdebug when loading de format edit page. - ๐ง๐ชBelgium Wim Leers Ghent ๐ง๐ช๐ช๐บ
TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in in_array() (line 659 of core/modules/ckeditor5/ckeditor5.module). ckeditor5_editor_presave(Object)
is referring to this line in 10.1.6:
if (in_array('codeBlock', $settings['toolbar']['items'], TRUE) && !isset($settings['plugins']['ckeditor5_codeBlock'])) {
It should not be possible for
$settings['toolbar']['items']
to be an array.Can you please provide a config export of your
editor
config entity, in all of the 3 languages you mentioned? ๐ - ๐ช๐ธSpain slajo
Here are my
basic_html
editor config files in tree diferent cases- es: This is the config in a modified site. The editor works fine if you remove de
sourceEditing
value from desettings.toolbar.items
list. If you add this value you have a JS error in de front (you see the tokens instead the buttons) and when try to change the editor to "none" you have the back error. - es default: The same case as above but I export the config from a clean default instalation
- en default: No errors ๐คฏ
- es: This is the config in a modified site. The editor works fine if you remove de
- ๐ช๐ธSpain slajo
In comment#15 es default case when
sourceEditing
plugin is added a JS error trowed (before saving the config, only dragging the plugin to enable it):Uncaught TypeError: Cannot set properties of undefined (setting 'value')
at Drupal.verticalTab.focus (vertical-tabs.js?v=10.1.6:199:65)
at vertical-tabs.js?v=10.1.6:117:42
at Array.forEach ()
at Object.attach (vertical-tabs.js?v=10.1.6:64:68)
at drupal.js?v=10.1.6:166:24
at Array.forEach ()
at Drupal.attachBehaviors (drupal.js?v=10.1.6:162:34)
at HTMLDivElement. (ajax.js?v=10.1.6:1362:20)
at Function.each (jquery.min.js?v=3.7.0:2:3129)
at ce.fn.init.each (jquery.min.js?v=3.7.0:2:1594)Everything works well in the en default case.
- ๐ช๐ธSpain jmohino
After upgrading to Drupal 10.2.2 I have the same problem when using css/js aggregation
- ๐ง๐ชBelgium Wim Leers Ghent ๐ง๐ช๐ช๐บ
Please provide exact steps to reproduce on a fresh Drupal site.