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

CommentFileSizeAuthor
#3 quantcdn-3416840.patch477 bytesabhishek_gupta1

Issue fork quantcdn-3416840

Command icon Show commands

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

Kristen Pol created an issue. See original summary.

abhishek_gupta1 made their first commit to this issue’s fork.

abhishek_gupta1’s picture

Status: Active » Needs review
StatusFileSize
new477 bytes

@Kristen Pol, issue is fixed , created Patch. please review the patch file

kristen pol’s picture

Thanks. Fix has been added in GitHub:

https://github.com/quantcdn/drupal/pull/222

I still need to test.

kristen pol’s picture

Title: Php 8.2 error: Deprecated function: Creation of dynamic property Drupal\quant_api\Client\QuantClient::$client is deprecated » Php 8.2 errors: Deprecated function: Creation of dynamic property
Assigned: kristen pol » Unassigned
Issue summary: View changes
Status: Needs review » Needs work

There 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}

Deprecated function: Creation of dynamic property Drupal\quant_api\Form\SettingsForm::$client is deprecated in Drupal\quant_api\Form\SettingsForm->__construct() (line 23 of /var/www/html/web/modules/contrib/quantcdn/modules/quant_api/src/Form/SettingsForm.php)
#0 /var/www/html/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(8192, 'Creation of dyn...', '/var/www/html/w...', 23)
#1 /var/www/html/web/modules/contrib/quantcdn/modules/quant_api/src/Form/SettingsForm.php(23): _drupal_error_handler(8192, 'Creation of dyn...', '/var/www/html/w...', 23)
Deprecated function: Creation of dynamic property Drupal\quant_search\Controller\Search::$client is deprecated in Drupal\quant_search\Controller\Search->__construct() (line 27 of /var/www/html/web/modules/contrib/quantcdn/modules/quant_search/src/Controller/Search.php)
#0 /var/www/html/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real(8192, 'Creation of dyn...', '/var/www/html/w...', 27)
#1 /var/www/html/web/modules/contrib/quantcdn/modules/quant_search/src/Controller/Search.php(27): _drupal_error_handler(8192, 'Creation of dyn...', '/var/www/html/w...', 27)
Deprecated function: Creation of dynamic property Drupal\quant_search\Form\SearchIndexForm::$client is deprecated in Drupal\quant_search\Form\SearchIndexForm->__construct() (line 23 of modules/contrib/quantcdn/modules/quant_search/src/Form/SearchIndexForm.php).
Drupal\quant_search\Form\SearchIndexForm->__construct(Object) (Line: 30)
Drupal\quant_search\Form\SearchIndexForm::create(Object) (Line: 28)
Deprecated function: Creation of dynamic property Drupal\quant_search\Form\SearchEntitiesForm::$client is deprecated in Drupal\quant_search\Form\SearchEntitiesForm->__construct() (line 23 of modules/contrib/quantcdn/modules/quant_search/src/Form/SearchEntitiesForm.php).
Drupal\quant_search\Form\SearchEntitiesForm->__construct(Object) (Line: 30)
Drupal\quant_search\Form\SearchEntitiesForm::create(Object) (Line: 28)
kristen pol’s picture

Assigned: Unassigned » kristen pol

Assigning to myself.

kristen pol’s picture

Status: Needs work » Needs review

Updated PR and tested locally.

kristen pol’s picture

Status: Needs review » Fixed

This has been merged in GitHub and will be synced to the d.o repo as part of the next release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kristen pol’s picture

Assigned: kristen pol » Unassigned

Unassigning.

kristen pol’s picture

Part of 1.6.1 release.