-
-
Notifications
You must be signed in to change notification settings - Fork 811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PHP 8.2] - Deprecated: Creation of dynamic... for links in messages #9562
Comments
I'am not able to reproduce this one on Php 8.2.x |
I have tried it on 3 different test sites with php 8.2.4 and php 8.2.9. |
Can-you add here the backtrace like that i can see where it's come ? |
Backtracking is hardly possible. But I noticed that this message, along with the many "deprecated" codes, is already displayed in Kunena 6.1. |
I have tried by enabling Auto-Link URLs but the error hasn't appear |
Well, let's leave the issue aside for now. If the error is there, it can only be seen anyway if the error reporting is at maximum. |
i can't see the error also |
Maybe this will help. I had overlooked the fact that three different warnings are displayed per link. Deprecated: Creation of dynamic property Kunena\Forum\Libraries\Layout\KunenaLayout::$url is deprecated in .../libraries/kunena/src/Layout/KunenaBase.php on line 570 Deprecated: Creation of dynamic property Kunena\Forum\Libraries\Layout\KunenaLayout::$target is deprecated in .../libraries/kunena/src/Layout/KunenaBase.php on line 570 Deprecated: Creation of dynamic property Kunena\Forum\Libraries\Layout\KunenaLayout::$internal is deprecated in ..../libraries/kunena/src/Layout/KunenaBase.php on line 570 |
Why ? If you xdebug enabled it shows directly the backend for each error displayed or else if you look in the log of php there are the backtrace for each error message |
|
Sorry, it was a mistake from me. The deprecated codes are still present. |
Hi,
with $this->{$key} you are setting keys that are not declared in KunenaBase.php. It still works but doing this is deprecated in PHP 8.2 and will stop working in newer PHP versions. So setting variables to an object must be refactored into another way of doing this. an approach would be to define a private array $data variable and the use $this->data[$key] = $value to set data in it. We then also net a get function that will then return the $data[$key] value. No idea what the impact of this change would be as now it is possible to directly get a variable from the object where then it is only possible to use the get function to get the variable |
I know, I have already corrected a lot in K6.2 of this deprecated, i have started a bit in K6.1. I have created the layout file if it's not exist to define variables. From the deprecated messages reported by rich, this i'am not able to see it :
|
You can do a e.g. for $this->internal I found the following: |
fixed mine: #9570 |
and was able to reproduce the $url, $target and $internal so also fixed these in same PR |
|
Thanks for testing @rich20 |
Already solved by this fix #9570 |
To Reproduce
Include simple links in a message, e.g.
https://www.kunena.org/
or
[url]https://www.kunena.org/[/url]
Actual result
Deprecated: Creation of dynamic property Kunena\Forum\Libraries\Layout\KunenaLayout::$url is deprecated in /.../libraries/kunena/src/Layout/KunenaBase.php on line 570
System information
Desktop
The text was updated successfully, but these errors were encountered: