Problem/Motivation

The current version of this module doesn't appear to support entity reference revisions (paragraph) fields. As a result, only the first paragraph renders its code snippet.

Paragraphs might not be the only use case affected by this bug.

Steps to reproduce

  1. Install this module and the paragraphs module.
  2. Create a text format that only uses the filter provided by this module and does not use the wysiwyg editor.
  3. Create a new paragraph that contains a formatted text field that includes your new text format.
  4. Create a node bundle that has a entity reference revisions field, allow references to the paragraph type that you created.
  5. Create a node of the new bundle you created.
  6. In your paragraphs field, add multiple paragraphs and add a code snippet to each paragraph (ie. <ace syntax="html">Test snippet 1/2/3</ace>)
  7. Save and view the page
  8. Observe only your first paragraph renders content and is styled as a code snippet.
  9. Optional: Open your dev tools > console and inspect the drupalSettings.ace_filter.instances array and observe there is only one instance.

Proposed resolution

In the AceFilter filter's process method, write the Drupal settings content to a static variable, so that prior instantiation's content persist each time the method is called per page load.

Additionally, ensure that the element ids are truly unique by generating a uuid instead of using an array key which would be repeated on subsequent instantiations of the method.

Issue fork ace_editor-3236361

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jesconstantine created an issue. See original summary.

jesconstantine’s picture

Uploading a patch with the changes contained in the merge request so that folks can test its inclusion via composer.

jesconstantine’s picture

Status: Active » Needs review
hngrytrl’s picture

Status: Needs review » Reviewed & tested by the community

interdruper’s picture

Status: Reviewed & tested by the community » Fixed

Committed to dev, thanks.

Status: Fixed » Closed (fixed)

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