Real-time Editing not work

Created on 15 November 2024, about 1 month ago

Problem/Motivation

I am working on Drupal 10.3.7 and using the admin theme Gin 8.x-3.0-rc14. I have installed the frontend_editing 1.8.4 module. In the settings, I enabled this module for a specific Content Type and a Paragraph Type used by that Content Type. After checking the "Instant Preview" option, which uses AJAX, I went back to edit my content via the module. The instant preview is not working (I tested with the variables {{ content }} and {{ content.frontend_editing }}). There are no error messages in the console or in the Drupal logs.

Steps to reproduce

1) install Drupal 10.3.x
2) install and use admin theme Gin 8.x-3.0-rc14
3) install frontend_editing 1.8.4
4) check the "Instant Preview" option in config

🐛 Bug report
Status

Needs work

Version

1.8

Component

Code

Created by

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

Comments & Activities

  • Issue created by @RayanD
  • 🇩🇪Germany a.dmitriiev

    Status "Needs work" is set for the issues that have some patch or MR that needs work. If there is nothing yet done, it should be just "Active"

  • 🇩🇪Germany a.dmitriiev

    As for the problem, are you trying to edit the paragraph or the content type and you don't see the real time updates?

    If possible, could you please check the response of the request? The uri should be like `/frontend-editing/form/paragraph/1010?view_mode_id=default&ajax_form=1&_wrapper_format=drupal_ajax`, the method is POST.

    In the response there should be an object similar to this:

    Object { command: "feEntityPreview", selector: '[data-fe-preview-content="90778e28-1e72-44d1-8807-c5a818288237"]', viewModeId: "default", … }
    

    This object contains ajax command that triggers the preview for the DOM element with selector data-preview="90778e28-1e72-44d1-8807-c5a818288237". Do you see this selector on the page? This data attribute is added to the entity wrapper (in this example is to paragraph wrapper), see here https://git.drupalcode.org/project/frontend_editing/-/blob/1.x/frontend_... . This also needs that attributes be printed in your entity's template. For example:

    <div{{ attributes }}>
      {{ content }}
    </div>
    
Production build 0.71.5 2024