No anchor flag button appears in Toolbar Configuration after install

Created on 1 December 2023, about 1 year ago
Updated 6 December 2023, about 1 year ago

Problem/Motivation

After following steps to install anchor_link for ckeditor5 and clearing drupal cache, the anchor link flag button does not appear in the available buttons for the ckeditor toolbar configuration. Not sure if I'm missing a step in the install, or am doing something wrong.

Steps to reproduce

  1. Run composer require wikimedia/composer-merge-plugin
  2. Add the extra "merge-plugin" json to composer.json as it appears under the section "Option #3" on the anchor_link module page
  3. Run composer require 'drupal/anchor_link:^3.0@alpha'
  4. Flush Drupal cache
  5. Go to Configuration->Content authoring->Text formats and editors
  6. Click Configure button for the Full HTML
  7. No flag button appears under Toolbar Configuration, with the CKEditor 5 selected as the editor
      Currently running Drupal 10.1.6.

      Proposed resolution

      Remaining tasks

    • ✅ File an issue
    • ➖ Addition/Change/Update/Fix
    • ➖ Testing to ensure no regression
    • ➖ Automated unit testing coverage
    • ➖ Automated functional testing coverage
    • ➖ UX/UI designer responsibilities
    • ➖ Readability
    • ➖ Accessibility
    • ➖ Performance
    • ➖ Security
    • ➖ Documentation
    • ➖ Code review by maintainers
    • ➖ Full testing and approval
    • ➖ Credit contributors
    • ➖ Review with the product owner
    • ➖ Release notes snippet
    • ❌ Release

    API changes

    • N/A

    Data model changes

    • N/A

    Release notes snippet

    • N/A
🐛 Bug report
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mkimmet
  • 🇨🇦Canada dylan donkersgoed London, Ontario

    @mkimmet Can you verify whether the JS library exists in your libraries directory (e.g. docroot/libraries/ckeditor5-anchor-drupal)?

  • Thanks for the quick reply Dylan! It looks like the folder docroot/libraries/ckeditor5-anchor-drupal is not there.

  • What l think is happening is that the folder docroot/libraries/ckeditor5-anchor-drupal was already present (because I had been trying to install this multiple times), and then when I ran composer require 'drupal/anchor_link:^3.0@alpha', it deleted the folder. Then when I tried removing the module, it added the folder back. Then it takes running composer require 2 times to get the folder back. It seems to be in some kind of mixed up state. Unfortunately, even when I have the folder present and the module installed, I'm still not seeing the flag button as an option.

  • 🇨🇦Canada dylan donkersgoed London, Ontario

    I'm going to try to run through the steps as documented with a clean Drupal site when I get the chance (probably won't be until this evening). I wrote them from memory/samples in my project and may have missed something. If you're in a hurry you can probably just grab the library directly from https://registry.npmjs.org/@northernco/ckeditor5-anchor-drupal/-/ckedito... and decompress it in the relevant folder, it just won't auto-update until you set it up the composer way.

  • 🇨🇦Canada dylan donkersgoed London, Ontario

    I tried installing on a clean D10 site and I can see the anchor link button when populating the toolbar in the text format.

    However, earlier today I did see a similar issue on another site. I haven't been able to pin down the cause though and may not for a few days (it's on my work computer). I did have some JS errors in the console unrelated to anchor_link which may have been the cause, though other toolbar icons worked fine.

    I don't think the issue is related to the external library after all. It shouldn't even be loaded on the admin page.

    As for why you had to run composer twice I suspect the issue was that before anchor_link was updated the composer.libraries.json file didn't exist or didn't have information about fetching the library, so the composer merge plugin didn't import those dependencies at first. I encountered the same issue when installing from the instructions on the module home page. I'll update them.

  • Status changed to Postponed: needs info about 1 year ago
  • 🇨🇦Canada dylan donkersgoed London, Ontario

    It appears I didn't actually have the module enabled on the site where I noticed this. So unable to reproduce the issue so far. If you could provide steps to reproduce with a clean Drupal site I may be able to help.

  • Thanks Dylan, I'll give it another try and start from the beginning and get back with you.

  • Status changed to Closed: works as designed about 1 year ago
  • Somewhere along the way I must have either disabled the module or never enabled it like you had experienced. After I installed the module the flag showed up. The empty anchor tags that I have in my content are disappearing now, but that was something I know others were working on and so I'll close this ticket and look into that.

Production build 0.71.5 2024