Problem/Motivation

Uncaught Error: ace.edit can't find div #edit-settings-block-form-body-0-value--zyrKaB4UBag-ace-editor

    at exports.edit (ace.js?v=10.1.2:20712:19)
    at Object.attach (editor.js?v=10.1.2:30:63)
    at Drupal.editorAttach (editor.js?v=10.1.2:302:37)
    at Object.success (editor.js?v=10.1.2:57:11)
    at c (jquery.min.js?v=3.7.0:2:25266)
    at Object.fireWith [as resolveWith] (jquery.min.js?v=3.7.0:2:26015)
    at l (jquery.min.js?v=3.7.0:2:77721)
    at XMLHttpRequest.<anonymous> (jquery.min.js?v=3.7.0:2:80204)

Steps to reproduce

  1. install drupal 10
  2. go to layout builder
  3. try to add HTML code

Proposed resolution

  • Change to use .js-form-type-textarea

Remaining tasks

  • File an issue
  • MR/Patch
  • Test
  • Review
  • Release

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Issue fork ace_editor-3386750

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

Ahmad Khader created an issue. See original summary.

Rajab Natshah made their first commit to this issue’s fork.

rajab natshah’s picture

rajab natshah’s picture

Title: ace editor HTML code throws error when it's used inside layout builder after upgrading to beta1. » Fix ace editor HTML code throws error when it's used inside layout builder after upgrading to beta1.

For some reasons, the following code

            // Creating a unique id for our new text editor
            var ace_editor_id = element_id+"-ace-editor";

is not adding the suffix -ace-editor to the #edit-settings-block-form-body-0-value--zyrKaB4UBag

rajab natshah’s picture

I confirm facing the same issue with any ACE Editor editing on any Front-End theme

With CKEditor 5

When switching to ACE Editor
ACE Editor error

rajab natshah’s picture

Assigned: Unassigned » rajab natshah

  • Rajab Natshah committed 75338871 on 2.0.x
    Issue #3386750: Fix ace editor HTML code throws error when it's used...
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Status: Active » Needs review
Issue tags: +ace_editor-2.0.0-beta2
rajab natshah’s picture

Status: Needs review » Fixed
rajab natshah’s picture

Title: Fix ace editor HTML code throws error when it's used inside layout builder after upgrading to beta1. » Fix ace editor HTML code throws error when it's used inside layout builder after upgrading to beta1
rajab natshah’s picture

Status: Fixed » Closed (fixed)

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