Problem/Motivation
When running php 8.2, you run into these deprecation errors when running the seed. Also see the comments for some additional errors.
https://php.watch/versions/8.2/dynamic-properties-deprecated
Deprecated function: Creation of dynamic property Drupal\quant_api\Client\QuantClient::$client is deprecated in Drupal\quant_api\Client\QuantClient->__construct() (line 74 of /opt/drupal/web/modules/contrib/quantcdn/modules/quant_api/src/Client/QuantClient.php)
#0 /opt/drupal/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(8192, 'Creation of dyn...', '/opt/drupal/web...', 74)
#1 /opt/drupal/web/modules/contrib/quantcdn/modules/quant_api/src/Client/QuantClient.php(74): _drupal_error_handler(8192, 'Creation of dyn...', '/opt/drupal/web...', 74)
#2 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(259): Drupal\quant_api\Client\QuantClient->__construct(Object(GuzzleHttp\Client), Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\Core\Logger\LoggerChannelFactory))
#3 /opt/drupal/web/core/lib/Drupal/Component/DependencyInjection/Container.php(177): Drupal\Component\DependencyInjection\Container->createService(Array, 'quant_api.clien...')
#4 /opt/drupal/web/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php(89): Drupal\Component\DependencyInjection\Container->get('quant_api.clien...')
Steps to reproduce
- Install/configure Drupal 10.1 on php 8.2
- Install/configure quant_api
- Create content
- Seed content
- Look at the logs
- Results: Errors shown above
- Expected results: No errors in the logs
Proposed resolution
Fix the deprecation.
Remaining tasks
- Update code
- Review and test
- Commit :)
User interface changes
No deprecation errors in the logs.
API changes
Data model changes
Comments
Comment #3
abhishek_gupta1 commented@Kristen Pol, issue is fixed , created Patch. please review the patch file
Comment #4
kristen polThanks. Fix has been added in GitHub:
https://github.com/quantcdn/drupal/pull/222
I still need to test.
Comment #5
kristen polThere are a few other deprecation errors that are similar so they should be fixed here as well. Please check the code for anything that's been missed. And it would be good to fix this other deprecation at the same time as well: #3417825: Php 8.2 error: PHP Deprecated: Using ${var} in strings is deprecated, use {$var}
Comment #6
kristen polAssigning to myself.
Comment #7
kristen polUpdated PR and tested locally.
Comment #9
kristen polThis has been merged in GitHub and will be synced to the d.o repo as part of the next release.
Comment #11
kristen polUnassigning.
Comment #12
kristen polPart of 1.6.1 release.