Follow-up to #2500527: Rewrite \Drupal\file\Controller\FileWidgetAjaxController::upload() to not rely on form cache

Problem/Motivation

In beta11 it was possible to align images uplaoded in the CKEditor by selecting a radio button in the popin. Since beta12 it is not possible anymore.

Investigation

$ git bisect start 8.0.0-beta12 8.0.0-beta11
At each step, reinstall Drupal standard, login and try to align an image in a page.

Result : 8b4bc7df8f30011a7d6e56d9b575694ee2d29ad7 is the first bad commit

Reverting changes introduced by this commit, the problem comes from the file module.

Steps to reproduce:

  1. $ git checkout 8b4bc7df8f30011a7d6e56d9b575694ee2d29ad7^
  2. Install drupal standard
  3. Login and create a page
  4. Insert an image in the body with align = right
  5. the image is aligned in the editor and in the saved content
  6. $ git checkout 8b4bc7df8f30011a7d6e56d9b575694ee2d29ad7
  7. Install drupal standard
  8. Login and create a page
  9. Insert an image in the body with align = right
  10. the image is not aligned in the editor nor in the saved content

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because that feature used to work
Issue priority Major because it's a widely used feature
Prioritized changes The main goal of this issue is to fix a regression

Proposed resolution

No idea.

Remaining tasks

Fix that regression.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

StuartJNCC’s picture

I confirm that align image does not work in beta-14, nor does image caption.

Manually adding the image-align or image-caption tags in the editor source also does not work (they get stripped out on Save), so I suspect it is the filters that are not working as expected.

duaelfr’s picture

Title: Image align radio in CKeditor does not work anymore » Image align radio and caption checkbox in CKeditor does not work anymore

I tried to dig a bit more in that issue.

The problem is that in EditorImageDialog::buildForm(), there is a call to FormStateInterface::getUserInput() that returns different array structure. When you open the Dialog, the $user_input['editor_object'] variable contains what's excepted but in the other cases, the expected values are in $user_input['attributes'].

That's all for today. I hope that could help someone to continue this fix.

kattekrab’s picture

duaelfr’s picture

Status: Active » Closed (duplicate)

The issue mentioned in the previous comment is a lot more advanced than this one.