Currently, the module is implementing hook_element_info_alter in order to register custom pre_render method for checking and post_render on form elements for loading the ckeditor_link settings, styles and scripts (in ckeditor_link_form_post_render).
This is working pretty well, as long as we don't have any js bahaviour interfering. When for example ajax is used to load the text form element, this is not working anymore.

Popular example would be loading forms via:
- https://www.drupal.org/project/field_collection
- https://www.drupal.org/project/inline_entity_form
- Probably edit module? (havent test this one)

Attached patch tested with inline_entity_form and without.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Hydra’s picture

bogdan.racz’s picture

I have observed that when loading form elements with AJAX, not the whole form is rendered and so the form "post render" is not triggered.
A possible solution is to attach the post render function on the "text format" element itself, not on the form.
Attached patch works with inline_entity_form and ckeditor module installed.

Steven Jones’s picture

Patch in #2 worked for me, thanks!

kevincrafts’s picture

Path in #2 worked for me too.

steel-track’s picture

Status: Needs review » Reviewed & tested by the community

I can verify patch in #2 works as well. Setting to RTBC since four people have verified.

anrikun’s picture

Title: User hook_wysiwyg_editor_settings_alter instead of hook_element_info_alter to add settings and load scripts » JS may fail to be added on some advanced forms
Category: Feature request » Bug report

  • anrikun committed 934c7c4 on 7.x-2.x authored by rbmboogie
    Issue #2382077 by Hydra, rbmboogie: JS may fail to be added on some...
anrikun’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.