Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

PHP Notice: Trying to access array offset on value of type null in Drupal\tide_api\Plugin\jsonapi\FieldEnhancer\YamlEnhancer->doUndoTransform() #82

Open
christopher-hopper opened this issue May 16, 2022 · 1 comment · May be fixed by #83
Assignees

Comments

@christopher-hopper
Copy link

Problem / Motivation

The Drupal logs are showing this PHP Notice quite a bit when submitting to Webform APIs.

Notice: Trying to access array offset on value of type null in Drupal\tide_api\Plugin\jsonapi\FieldEnhancer\YamlEnhancer->doUndoTransform() (line 27 of /app/docroot/modules/contrib/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php)

Stack trace:

#0 /app/docroot/core/includes/bootstrap.inc(312): _drupal_error_handler_real(8, 'Trying to acces...', '/app/docroot/mo...', 27)
#1 /app/docroot/modules/contrib/tide_api/src/Plugin/jsonapi/FieldEnhancer/YamlEnhancer.php(27): _drupal_error_handler(8, 'Trying to acces...', '/app/docroot/mo...', 27, Array)
#2 /app/vendor/e0ipso/shaper/src/DataAdaptor/DataAdaptorTransformerTrait.php(57): Drupal\tide_api\Plugin\jsonapi\FieldEnhancer\YamlEnhancer->doUndoTransform(Array, Object(Shaper\Util\Context))
#3 /app/docroot/modules/contrib/jsonapi_extras/src/Normalizer/ResourceObjectNormalizer.php(56): Drupal\jsonapi_extras\Plugin\ResourceFieldEnhancerBase->undoTransform('email:\n  '#type...', Object(Shaper\Util\Context))
#4 /app/docroot/modules/contrib/jsonapi_extras/src/Normalizer/ResourceObjectNormalizer.php(29): Drupal\jsonapi_extras\Normalizer\ResourceObjectNormalizer::enhanceConfigFields(Object(Drupal\jsonapi\JsonApiResource\ResourceObject), Array, Object(Drupal\jsonapi_extras\ResourceType\ConfigurableResourceType))
#5 /app/vendor/symfony/serializer/Serializer.php(153): Drupal\jsonapi_extras\Normalizer\ResourceObjectNormalizer->normalize(Object(Drupal\jsonapi\JsonApiResource\ResourceObject), 'api_json', Array)
#6 /app/docroot/core/modules/jsonapi/src/Serializer/Serializer.php(62): Symfony\Component\Serializer\Serializer->normalize(Object(Drupal\jsonapi\JsonApiResource\ResourceObject), 'api_json', Array)
#7 /app/docroot/core/modules/jsonapi/src/Normalizer/DataNormalizer.php(26): Drupal\jsonapi\Serializer\Serializer->normalize(Object(Drupal\jsonapi\JsonApiResource\ResourceObject), 'api_json', Array)
#8 [internal function]: Drupal\jsonapi\Normalizer\DataNormalizer->Drupal\jsonapi\Normalizer\{closure}(Object(Drupal\jsonapi\JsonApiResource\ResourceObject))
#9 /app/docroot/core/modules/jsonapi/src/Normalizer/DataNormalizer.php(27): array_map(Object(Closure), Array)
#10 /app/vendor/symfony/serializer/Serializer.php(153): Drupal\jsonapi\Normalizer\DataNormalizer->normalize(Object(Drupal\jsonapi\JsonApiResource\ResourceObjectData), 'api_json', Array)
#11 /app/docroot/core/modules/jsonapi/src/Serializer/Serializer.php(62): Symfony\Component\Serializer\Serializer->normalize(Object(Drupal\jsonapi\JsonApiResource\ResourceObjectData), 'api_json', Array)
#12 /app/docroot/core/modules/jsonapi/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php(191): Drupal\jsonapi\Serializer\Serializer->normalize(Object(Drupal\jsonapi\JsonApiResource\ResourceObjectData), 'api_json', Array)
#13 /app/vendor/symfony/serializer/Serializer.php(153): Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer->normalize(Object(Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel), 'api_json', Array)
#14 /app/docroot/core/modules/jsonapi/src/Serializer/Serializer.php(62): Symfony\Component\Serializer\Serializer->normalize(Object(Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel), 'api_json', Array)
#15 /app/docroot/core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php(120): Drupal\jsonapi\Serializer\Serializer->normalize(Object(Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel), 'api_json', Array)
#16 /app/docroot/core/modules/jsonapi/src/EventSubscriber/ResourceResponseSubscriber.php(85): Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber->renderResponseBody(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\jsonapi\CacheableResourceResponse), Object(Drupal\jsonapi\Serializer\Serializer), 'api_json')
#17 [internal function]: Drupal\jsonapi\EventSubscriber\ResourceResponseSubscriber->onResponse(Object(Symfony\Component\HttpKernel\Event\ResponseEvent), 'kernel.response', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#18 /app/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ResponseEvent), 'kernel.response', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#19 /app/vendor/symfony/http-kernel/HttpKernel.php(191): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ResponseEvent), 'kernel.response')
#20 /app/vendor/symfony/http-kernel/HttpKernel.php(179): Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object(Drupal\jsonapi\CacheableResourceResponse), Object(Symfony\Component\HttpFoundation\Request), 1)
#21 /app/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#22 /app/docroot/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(67): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /app/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /app/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /app/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php(49): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /app/docroot/modules/contrib/shield/src/ShieldMiddleware.php(265): Asm89\Stack\Cors->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /app/docroot/modules/contrib/shield/src/ShieldMiddleware.php(221): Drupal\shield\ShieldMiddleware->bypass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /app/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\shield\ShieldMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /app/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /app/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /app/docroot/core/lib/Drupal/Core/DrupalKernel.php(717): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /app/docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#33 {main}.
@christopher-hopper
Copy link
Author

Found this in the logs when investigating issue for Victoria Legal Aid (VLA)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants