i just installed the latest grav+admin bundle 1.7.38. I am running the built-in dev server ‘bin/grav server’ on php 8.2.1 and if i hit 127.0.0.1:8000 i get this weird message:
i get the same on a fresh install, on a laptop screen the log in form is pushed off the bottom of the screen, and there is some no scroll behaviour, so only way to get to see the whole form is to tab through all the inputs. not a great first experience…
i’ll follow you’re advice on disabling deprecated errors thanks!
In PHP classes, it is possible to dynamically set and retrieve class properties that are not declared.
[…] In PHP 8.2 and later, setting a value to an undeclared class property is deprecated , and emits a deprecation notice the first time the property is set during the lifetime of the application execution.
Adding dynamic properties may be nescessary when loading json or yaml files of which the content is not known upfront. Think of custom media meta files like image1.jpg.meta.yaml, or yaml files created by the Forms plugin or Comments plugin.
To prevent the deprecation warning to be thrown, a new attribute has been defined:
PHP 8.2 introduces a new attribute in the global namespace named #[AllowDynamicProperties]. Classes declared with this attribute signals PHP to not emit any deprecation notices when setting dynamic properties on objects of that class.
The Grav team probably hasn’t had yet the time/resources to add this attribute to mitigate the deprecation…
thanks a lot for sharing. I wasn’t able to care much about this due to ongoing projects.
@skrambledagg
So this can be fixed by downgrading the local php version to 8.1 (i remember 8.1 don’t show up these erros) or i.e. mamp is used, you may install and switch php version there.