When visiting the following URL:
`admin/content/simplenews-stats/1`
The following deprecation messages appear:
Deprecated function: Creation of dynamic property Drupal\simplenews_stats\SimplenewsStatsPage::$count_view is deprecated in Drupal\simplenews_stats\SimplenewsStatsPage->queryCount() (line 324 of modules/contrib/simplenews_stats/src/SimplenewsStatsPage.php).
Deprecated function: Creation of dynamic property Drupal\simplenews_stats\SimplenewsStatsPage::$count_click is deprecated in Drupal\simplenews_stats\SimplenewsStatsPage->queryCount() (line 324 of modules/contrib/simplenews_stats/src/SimplenewsStatsPage.php).
This issue seems to be related to the creation of dynamic properties, which is deprecated and incompatible with PHP 8.2 and newer. It is recommended to refactor the code by explicitly declaring the `$count_view` and `$count_click` properties in the `SimplenewsStatsPage` class.
Additionally, the following controller shows a deprecation message:
Deprecated function: Creation of dynamic property Symfony\Component\HttpFoundation\Response::$targetUrl is deprecated in Drupal\simplenews_stats\Controller\SimplenewsStatsController->customTrustedRedirect() (line 133 of modules/contrib/simplenews_stats/src/Controller/SimplenewsStatsController.php).
Comments
Comment #2
gonzalo2683 commentedComment #3
damien laguerre commentedThe deprecation in SimplenewsStatsPage was solved here: https://www.drupal.org/project/simplenews_stats/issues/3442000
What version of the module are you using?
Comment #5
gonzalo2683 commentedThank you for your response. I noticed that, although this issue was resolved in another ticket, the change never made it into the 4.0.0-beta1 branch. I’m currently using that branch, which is why I’m still encountering the deprecation issue, but I see that it has been fixed with beta 2.
Comment #6
damien laguerre commentedThanks for your feedback!
Yes, I've made a commit to fix your second point.
The new version contains both corrections.