getAdditionalMappings() Error when using paragraph library items

Created on 2 December 2024, 20 days ago

Problem/Motivation

When using paragraph library items (a submodule in Paragraphs β†’ ), when placing a paragraph library item on page, after saving and viewing the page, the page breaks, with a white screen.
Locally we see the following error:
The website encountered an unexpected error. Try again later.

Error: Call to a member function getAdditionalMappings() on null in Drupal\schemadotorg_additional_mappings\SchemaDotOrgAdditionalMappingsJsonLdManager->schemaPropertyAlter() (line 147 of modules/contrib/schemadotorg/modules/schemadotorg_additional_mappings/src/SchemaDotOrgAdditionalMappingsJsonLdManager.php).
schemadotorg_additional_mappings_schemadotorg_jsonld_schema_property_alter() (Line: 552)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 274)
Drupal\schemadotorg_jsonld\SchemaDotOrgJsonLdBuilder->getSchemaPropertyFieldItems() (Line: 207)
Drupal\schemadotorg_jsonld\SchemaDotOrgJsonLdBuilder->buildMappedEntity() (Line: 133)
Drupal\schemadotorg_jsonld\SchemaDotOrgJsonLdBuilder->buildEntity() (Line: 88)
Drupal\schemadotorg_jsonld\SchemaDotOrgJsonLdBuilder->build() (Line: 76)
schemadotorg_jsonld_page_attachments_alter() (Line: 552)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 319)
Drupal\Core\Render\MainContent\HtmlRenderer->invokePageAttachmentHooks() (Line: 285)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 284)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 53)
Asm89\Stack\Cors->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 38)
Drupal\mercury_editor\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Some additional context is that we are using mercury editor β†’ to build our pages which in turn relies on layout paragraphs β†’ .

The issue still lies within the schemadotorg submodule, schemadotorg_additional_mappings.
But additional context is always useful

Steps to reproduce

  1. Install schemdotorg, paragraphs, paragraphs_library, schemadotorg_additional_mappings and all necessary submodules
  2. setup a content type with a schema dot org type and with a paragraph field. One of the allowed paragraph type in the field should be the from_library paragraph type
  3. Setup that content type with additional mappings
  4. Be sure there is at least one other paragraph type on your site, if not add one, any fields are fine, body, simple text, etc. Also be sure that paragraph has some basic display setup that works and displays correctly.
  5. Add a new paragraph library item at admin/content/paragraphs/add/default of any type of paragraph that you are certain is setup and displays correctly
  6. Add a new piece of content that was setup, above that includes the paragraph field, with from_library and additional mappings setup
  7. Add a library from the paragraph library to your paragraph field. Fill out any other necessary field and save
  8. See the broken page with the above error

Proposed resolution

Implement the patch included in this issue to fix the problem.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States devanbicher

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

Comments & Activities

Production build 0.71.5 2024