Opened 11 years ago

Closed 11 years ago

#10440 closed Bug (duplicate)

<a> tag is not allowed when ACF is set to "automatic mode"

Reported by: Irina Owned by:
Priority: Normal Milestone:
Component: General Version: 4.1
Keywords: IBM Cc: Teresa Monahan

Description

We have a 'Link Menu' which combines 'link' and 'anchor' icons into one toolbar entry. If ACF is set to "automatic mode" and toolbar has the 'Link Menu' then all options under the 'Link Menu' are disabled, <a> tag is not allowed. If ACF is set to "automatic mode" and toolbar has the 'Link Menu' and the 'link' icon as an individual toolbar icon then all options under the 'Link Menu' are enabled and <a> tag is allowed.

Steps to reproduce:

  1. unzip linkmenu_testcase.zip. Copy the linkmenu folder to the ckeditor/plugins directory and the config.js file to the root ckeditor folder.
  2. Open any CKEditor sample in the browser.
  3. Open the toolbar menu item

Expected result: As link plugin is loaded, we expect to see 2 options under the 'Link Menu', e.g. 'Edit Link' and 'Image' options and all links displayed in the per-entered content as <a> tag should be allowed.

Actual result: Only 'Image' option is available. No links displayed in the per-entered content.

If you will type 'console.log('is <a> tag allowed: ', CKEDITOR.instances.editor1.filter.check('a'));' in the browser's debugging console, then output will be False.

Note: If you uncomment the config.toolbar = [ [ 'MyLinkMenu','Link','Image' ] ]; line in the config.js then it will display the 'Link Menu' and the 'link' icon as an individual toolbar icon and behavior will be as expected.

Attachments (1)

linkmenu_testcase.zip (1.8 KB) - added by Irina 11 years ago.

Download all attachments as: .zip

Change History (2)

Changed 11 years ago by Irina

Attachment: linkmenu_testcase.zip added

comment:1 Changed 11 years ago by Piotrek Koszuliński

Resolution: duplicate
Status: newclosed

This happens because positions of menu button are not yet registered automatically as features. I just created ticket for this: #10442.

For now simple solution is to use editor.addFeature() passing there buttons/commands. Basically something like:

editor.addFeature( editor.getCommand( 'link' ) );
editor.addFeature( editor.getCommand( 'image' ) );

// To ensure correct loading order you'll need to add link and image as required plugins.

This situation is described in Plugin integration with ACF guide in "A button, command or maybe a plugin – which of them is a feature?"

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy