Problem/Motivation

When attempting to add some paragraphs to a page we get an ajax error thrown with the following error:

Call to a member function getEntityTypeId() on null in Drupal\mercury_editor\Cache\MercuryEditorPreviewCacheContext->getContext() (line 41 of /app/docroot/modules/contrib/mercury_editor/src/Cache/MercuryEditorPreviewCacheContext.php).

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

johntarling created an issue. See original summary.

johntarling changed the visibility of the branch 3508661-ajax-error-when to hidden.

johntarling changed the visibility of the branch 2.2.x to hidden.

johntarling changed the visibility of the branch 3508661-ajax-error-when to active.

johntarling changed the visibility of the branch 2.2.x to active.

johntarling’s picture

Status: Active » Needs review

Created a quick fix for this by just checking that the entity is available before fetching the UUID.

johntarling changed the visibility of the branch 3508661-ajax-error-when to hidden.

pbabin’s picture

StatusFileSize
new61.09 KB

We ran into this issue as well on our site - specifically it was occurring on paragraphs that included entity references.

Applied patch and issue is resolved for us.

screenshot of paragraph type showing entity reference

joelsteidl’s picture

I can confirm that the patch fixed things for me as well.

My paragraph had an entity reference, so that checks out for consistency.

pixelwhip’s picture

Status: Needs review » Reviewed & tested by the community

pixelwhip changed the visibility of the branch 2.2.x to hidden.

pixelwhip’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for this fix. I've rerolled this change on the latest form 2.2.x and merged it in.

pixelwhip’s picture

Status: Fixed » Closed (fixed)

Released in version 2.2.3