Closed jowan closed 5 years ago
Hi there,
Getting an error similar to #316 and the reported issue on drupal.org https://www.drupal.org/project/jsonapi/issues/3007823
Fresh install, following the instructions, installation went great, all looked great util viewing the example nodes from content admin.
Using php7.1 $ drush runserver not apache
Error is as follows, for http://127.0.0.1:8888/node/61
The website encountered an unexpected error. Please try again later. TypeError: Argument 3 passed to Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel::__construct() must be an instance of Drupal\jsonapi\JsonApiResource\LinkCollection, array given, called in /var/www/vhosts/contenta/web/modules/contrib/jsonapi_extras/src/EntityToJsonApi.php on line 124 in Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel->__construct() (line 58 of modules/contrib/jsonapi/src/JsonApiResource/JsonApiDocumentTopLevel.php). Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel->__construct(Object, Object, Array) (Line: 124) Drupal\jsonapi_extras\EntityToJsonApi->normalize(Object) (Line: 371) contenta_enhancements_node_view_alter(Array, Object, Object) (Line: 539) Drupal\Core\Extension\ModuleHandler->alter('node_view', Array, Object, Object) (Line: 286) Drupal\Core\Entity\EntityViewBuilder->buildMultiple(Array) (Line: 220) Drupal\Core\Entity\EntityViewBuilder->build(Array) call_user_func(Array, Array) (Line: 378) Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195) Drupal\Core\Render\Renderer->render(Array, ) (Line: 226) Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227) Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117) Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90) Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) call_user_func(Array, Object, 'kernel.view', Object) (Line: 111) Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 67) Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 57) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 41) Drupal\jsonapi\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 49) Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 47) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23) Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 693) Drupal\Core\DrupalKernel->handle(Object) (Line: 19) require('/var/www/vhosts/contenta/web/index.php') (Line: 62)
Could this be a similar JSON API vs Contenta requirements versions issue ?
Thanks
Sorry, issue is not with Contenta https://www.drupal.org/project/jsonapi_extras/issues/3027768
Thanks for looping back and closing this issue.
Hi there,
Getting an error similar to #316 and the reported issue on drupal.org https://www.drupal.org/project/jsonapi/issues/3007823
Fresh install, following the instructions, installation went great, all looked great util viewing the example nodes from content admin.
Using php7.1 $ drush runserver not apache
Error is as follows, for http://127.0.0.1:8888/node/61
Could this be a similar JSON API vs Contenta requirements versions issue ?
Thanks