0

I'm trying to install the CK Editor Media Embed module for a client's Drupal 7 to Drupal 9 migration, since the old CK Editor 4 Iframe embedding doesn't seem to be available in Drupal 9.

I've followed the ("easy") instructions i.e. install/enable the module, and then run the drush ckeditor_media_embed:install command.

This unfortunately completely breaks the Drupal front-end, with an invalid argument exception thrown in the following code in the modules's Embed.php, due to the embed provider being NULL (it's supposed to be a URL).

$embed_provider = $this->configFactory->get('ckeditor_media_embed.settings')->get('embed_provider');
    $this->setEmbedProvider($embed_provider);

Running select * from cache_config where cid = 'ckeditor_media_embed.settings' on my DB gives the following, so there is definitely no provider in the config.

Query results

I'm assuming that the drush command is supposed to put some default value in this config table, but for some reason it hasn't been able to find anything. In the module code there is a file config/install/ckeditor_media_embed.settings.yml with the value:

embed_provider: 'http://ckeditor.iframe.ly/api/oembed?url={url}&callback={callback}'

but this is not being picked up at runtime - instead the config is taken from the database.

I've hacked the database to supply a default value myself and it works, but presumably that's not the intended use?

update cache_config set data = 'a:2:{s:25:"plugins_version_installed";s:6:"35.4.0";s:14:"embed_provider";s:66:"https://noembed.com/embed?url={url}&callback={callback}";}' where cid = 'ckeditor_media_embed.settings'

If anyone has used this before and has any pointers I'd be very grateful. Thank you!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.