Closed (fixed)
Project:
JSON-RPC
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Oct 2023 at 07:10 UTC
Updated:
13 Sep 2024 at 22:49 UTC
Jump to comment: Most recent
When using this module with PHP 8.2, there are some deprecation notices:
Deprecated function: Creation of dynamic property Drupal\jsonrpc\Annotation\JsonRpcMethod::$output is deprecated in Drupal\Core\Cache\ApcuBackend->getMultiple() (line 90 of core/lib/Drupal/Core/Cache/ApcuBackend.php).
Drupal\Core\Cache\ApcuBackend->getMultiple(Array, ) (Line: 141)
Drupal\Core\Cache\ChainedFastBackend->getMultiple(Array, ) (Line: 103)
Drupal\Core\Cache\ChainedFastBackend->get('jsonrpc_plugins') (Line: 37)
Drupal\Core\Plugin\DefaultPluginManager->cacheGet('jsonrpc_plugins') (Line: 213)
Drupal\Core\Plugin\DefaultPluginManager->getCachedDefinitions() (Line: 179)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 22)
Drupal\Core\Plugin\DefaultPluginManager->getDefinition('user.verify_email', ) (Line: 117)
Drupal\jsonrpc\Handler->getMethod('user.verify_email') (Line: 101)
Drupal\jsonrpc\Handler->supportsMethod('user.verify_email') (Line: 128)
Drupal\jsonrpc\Shaper\RpcRequestFactory->denormalizeParams(Array, Object) (Line: 110)
Drupal\jsonrpc\Shaper\RpcRequestFactory->denormalizeRequest(Array, Object) (Line: 88)
Drupal\jsonrpc\Shaper\RpcRequestFactory->Drupal\jsonrpc\Shaper\{closure}(Array)
array_map(Object, Array) (Line: 87)
Drupal\jsonrpc\Shaper\RpcRequestFactory->doTransform(Array, Object) (Line: 33)
Shaper\Transformation\TransformationBase->transform(Array, Object) (Line: 214)
Drupal\jsonrpc\Controller\HttpController->getRpcRequests(Object) (Line: 152)
Drupal\jsonrpc\Controller\HttpController->resolve(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 182)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)Call a JSON:RPC operation with PHP 8.2.
Eliminate the deprecation notice.
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
Comment #3
ptmkenny commentedDeclaring the property fixes the issue for me, but I'm not sure if my comment is correct. Tentatively setting to NR.
Comment #5
cspitzlay@ptmkenny: Regarding the question in #3 about the comment above the property:
I think your stacktrace is from a reviving such an object while fetching it from cache.
The only write access to this property I could find in regular code is in:
Drupal\jsonrpc\Plugin\JsonRpcMethodManager->alterDefinitions()
and that is where I got this deprecation message.
It looks to me as if it was the output schema that went into that property.
I will amend the comment accordingly and adapt the type to match the return type of \Drupal\jsonrpc\Plugin\JsonRpcMethodBase::outputSchema() which is where the value that is written comes from.
Comment #6
ptmkenny commentedComment #7
ptmkenny commentedComment #9
ptmkenny commented