runtime error after installing module

Created on 11 December 2024, 12 days ago

Problem/Motivation

I just installed this module and when I went to the settings page @ /admin/config/search/jsonld, I saw the following runtime error:

Warning: foreach() argument must be of type array|object, null given in Drupal\jsonld\Form\JsonLdSettingsForm->buildForm() (line 53 of modules/contrib/jsonld/src/Form/JsonLdSettingsForm.php).
Drupal\jsonld\Form\JsonLdSettingsForm->buildForm()
call_user_func_array() (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 704)
Drupal\Core\DrupalKernel->handle() (Line: 19)

šŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @monaw
  • additionally, i created a node from one of our custom content types and went to view it @ /node/1?_format=jsonld , i got the response "{"message":"Not acceptable format: jsonld"}"

  • First commit to issue fork.
  • šŸ‡µšŸ‡­Philippines paraderojether

    Hi

    I reviewed MR!2, applied it against JSON-LD REST Services 3.0.2 and confirmed it fixes the runtime error displayed on the configuration page.

    āžœ  jsonld git:(main) āœ— curl https://git.drupalcode.org/project/jsonld/-/merge_requests/2.diff |
     patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1104    0  1104    0     0   3604      0 --:--:-- --:--:-- --:--:--  3680
    patching file 'src/Form/JsonLdSettingsForm.php'
    āžœ  jsonld git:(main)

    I also added screenshots for reference.
    Thank you.

  • terrific! i eagerly await a fixed release (:

Production build 0.71.5 2024