Problem/Motivation

Tested with a blank 8.0.2 version of drupal on pretty standard environment.

steps to reproduce:
- install drupal 8
- edit basic html text format -> add justiy left, center, right, block to the toolbar (anywhere)
- save text format
- go to node/add/page

-> added buttons are not showing up. tested with cache rebuild and a complete development environment.

if needed:
Database system version 5.5.42
PHP 5.6.10
(but the problem exists on all environment we tested)

Proposed resolution

TBD. See #11.

TEMPORARY WORK-AROUND: see #10.

Remaining tasks

TBD

User interface changes

None.

API changes

TBD

Data model changes

TBD

Comments

nodestroy created an issue. See original summary.

droplet’s picture

Version: 8.0.2 » 8.0.x-dev
Category: Support request » Bug report

It's a bug, the toolbar do not sync with input configs.

we have an issue with patch for that but I can't find it anymore sadly. :(

nodestroy’s picture

ok, thanks for clarifying.
i did some research, but did not found anything, maybe you got another hint for me, where to search?

zviryatko’s picture

Buttons will not be shown if you have "Limit allowed HTML tags and correct faulty HTML" filter enabled, you can disable this filter (security risk) or add to each element in "Allowed HTML tags" setting this few classes: <p class="text-align-left text-align-center text-align-right text-align-justify">. You must add "class" attribute to each element which you want to align.

nodestroy’s picture

thanks for that, works like a charm.
if there is a issue for that bug out there, can we close this? otherwise, how to document that behavior?

zviryatko’s picture

Module Filter provides form element "text_format" and filter plugin (see FilterInterface), then Editor module alter text_format element and apply all editor plugins (see EditorPluginInterface) to this element, btw one of editor plugin contains in ckeditor module (see Drupal\ckeditor\Plugin\Editor\CKEditor)...
In few words: editor module is affects on input form through hook form alter, but can't affect on output filtering, because it's in responsibility of filter module.

echoz’s picture

The solution in #4 is documented in the help text (which I also took a while before noticing!) where it states a wildcard * can be used, so we only need <p class="text-align-*">

cilefen’s picture

Title: Justify buttons no appearing for editors » Justify buttons not appearing for editors
droplet’s picture

Let's see if @Wim Leers could give us some hints.

Hardly to understand the code in editor & filter & CKEditor modules.

Wim Leers’s picture

Title: Justify buttons not appearing for editors » Alignment/justify buttons not appearing for CKEditor, <p class="text-align-left text-align-center text-align-right text-align-justify"> not being whitelisted automatically
Component: editor.module » ckeditor.module
Related issues:

It is indeed related to #2549077: Allow the "Limit allowed HTML tags" filter to also restrict HTML attributes, and only allow a small whitelist of attributes by default, which now causes more strict CKEditor ACF restrictions.

The alignment buttons need classes to function. From \Drupal\ckeditor\Plugin\CKEditorPlugin\Internal::getConfig():

'justifyClasses' => array('text-align-left', 'text-align-center', 'text-align-right', 'text-align-justify'),

So those classes need to be allowed on the <p> tag. i.e. you need to add this to the Limit allowed HTML tags and correct faulty HTML filter setting:

<p class="text-align-left text-align-center text-align-right text-align-justify">

Of course, that should be happening automatically. That's the actual bug to address here.

Wim Leers’s picture

Issue summary: View changes

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.