Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No component or dynamic content item error after editing an email with dynamic content in GrapeJS code mode #48

Open
putzwasser opened this issue Jan 23, 2024 · 3 comments

Comments

@putzwasser
Copy link

Editing an email via the code mode editor fails if you have a Dynamic Content element in your email.

  1. Add a Dynamic Content block to an email
  2. Open the code mode editor pane (Edit Code)
  3. Edit some code (or don't) and click Save

The editor shows an alert:

No component or dynamic content item

see this isse for further reference: mautic/mautic#12481

The issue is in https://github.com/mautic/grapesjs-preset-mautic/blob/main/src/dynamicContent/dynamicContent.service.js#L151. dcItem is undefined when you try to save.

@LordRembo
Copy link
Contributor

LordRembo commented Apr 9, 2024

The root cause, is a condition is missing from the 'remove' event, causing the ID to be removed from storage when opening the Editor. My update PR fixes this issue.
This is the specific code in src/dynamicContent/dynamicContent.events.js for reference

@LordRembo
Copy link
Contributor

Never mind, was looking at the wrong issue reference.

@LordRembo
Copy link
Contributor

I think this was fixed with other PR's getting merged. Can you confirm if it's resolved in 5.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants