Problem/Motivation

Currently, the default revision of an embedded_paragraphs entity seems to be the original entity. All new revisions are drafts.

This can cause problems when you are using the e_p entity in other code to access paragraph info. Instead of the current paragraph, you get the original revision.

This may be due to some changes in tightening up the rules for managing entities in recent 11.x versions.

Steps to reproduce

  • Create an embeded paragraph via ckeditor / save the node
  • Edit the node and change something in the paragraph / save the node
  • Programatically load the e_p entity related to this node via uuid or id
  • Get the associated paragraph from the entity with getParagraph
  • You will have the original paragraph and not the latest.

Proposed resolution

Add $embed_paragraph->isDefaultRevision(TRUE); line before saving the entity in the ParagraphEmbedDialog->save method.

Remaining tasks

Add line

User interface changes

n/a

API changes

n/a

Data model changes

n/a

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

cgmonroe created an issue. See original summary.

cgmonroe’s picture

Merge request created with change.

For those who don't trust mr generated patch security, here's a standalone patch.