I noticed that adding/editing (CKEditor) images on admin area loads in bootstrap theme files (css and js). I don't see any bug reports related to that.
Current configuration: subtheme, cdn, checked out from git.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rang501 created an issue. See original summary.

Pierrere’s picture

Trying to add images actually does not work, here are the errors. They are generated for any sub- and the base-theme.

warning  php  Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'bootstrap_form_process' not found or invalid function name in Drupal\Core\Form\FormBuilder->doBuildFor
notice  php  Notice: Undefined index: #build_id in Drupal\Core\Form\FormBuilder->processForm() (line 591 of /my/drupal/path/core/lib/Drupal/Core/Form/FormBuilder.php).

Here is a video of the symptoms: YouTube Video

Drupal 8.0.0 with CKeditor version (8.0.0 - the onboard one)
Bootstrap 8.x-3.0-alpha1 and 8.x-3.x-dev (Nov. 21st 2015)

xlyz’s picture

Priority: Normal » Major
xlyz’s picture

after some investigation looks like image is correctly uploaded, but then ckeditor plugin is not able to set the img tag attributes with the image data, in spite of the fact that ajax request and response are exactly the same than using any core theme (that does work).

thare are also a couple of span elements that should not be there.

xlyz’s picture

xlyz’s picture

unsetting bootstrap_form_process for editor_image_dialog form seems to fix this issue. not sure if this can cause other problems.

patch included.

xlyz’s picture

Status: Active » Needs review
xlyz’s picture

Title: Opening image dialog in CKEditor loads bootstrap files into admin » image dialog in CKEditor does not works
FileSize
739 bytes

oops. there was an empty() missing. correct patch attached.

Pierrere’s picture

Patch in #5 cleans up the image dialogue and works well.
Patch in #8 works, I can insert images with CKeditor's dialogue on admin interface and inpage-quickedit. Experienced no other problems so far, will report back if something comes up

(I had to apply it manually as neither "git apply" nor "patch -p1" would patch my file, but that might be an error on my side, don't read too much into it yet)

Patched against the dev version, but from the structure of the patches itself, I'd say they should work on any D8 Bootstrap version.

Quick work "xlyz"
Thanks

markhalliwell’s picture

Assigned: Unassigned » markhalliwell
Priority: Major » Normal
Status: Needs review » Needs work

This will definitely need work after I'm finished with #2624420: Restructure code into OO (see the 8.x-OOP branch if you're curious). However, I suspect I'll need to do the work once that's merged. I'll take a look at this once it's done.

dangreen’s picture

This patch comments out an unnecessary ‘use’ statement as well as a
preprocess that makes adding inline images impossible.
- Crypt was not being used, so I commented it out
- There is a problem with setting `$element['#process’][]`

After making these changes I can upload images normally.

markhalliwell’s picture

The patch in #11 will not be committed. That removes all form element processing.

markhalliwell’s picture

Assigned: markhalliwell » Unassigned
Status: Needs work » Fixed

Fixed this as part of #2628530: Introduce a proper Update API.

The subsequent portion of that commit is: http://cgit.drupalcode.org/bootstrap/diff/src/Plugin/Alter/ElementInfo.p...

Essentially, if the $type === 'form', don't add anything since it messes up all AJAX callbacks (not just this particular case).

Status: Fixed » Closed (fixed)

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