Clean Installation -> "Deprecated" Error Message

Hello there,

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 i get this weird message:

I have no clue. I never run into this.

I tried another dev enviroment (1.7.32) with the same error on the /admin route. Is php 8.2.1 not suitable?

Thanks in advance.

1 Like

At least it can be disabled in the php.ini:

error_reporting = E_ALL & ~E_DEPRECATED
1 Like

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!

i actually think updating the login plugin might have fixed the errors?

Hi @skrambledagg,

it’s not the usal behavior and this type of php errors indicate imo a wrong configured php enviroment. Please share your setup:

  1. System?
  2. PHP version
  3. Using built-in server or MAMMP etcpp?
  4. More info etcpp…

Btw, you can change the scroll behavior in the browsers dev tools.

Disabling the messages via php.ini won’t fix it either. I got some additional issues:

  1. The news in the dashboard cannot be loaded.
  2. If you hit a wrong url (using a wrong slug), no error page is displayed but a backtrace error page instead. Which is not the usal behavior.

You can always update grav without logging using the grav cli:

bin/gpm self-upgrade
bin/gpm update

More Info: Grav-GPM. I updated and it doesn’t fix the issue in my case.

Best regards

According the following doc on PHP 8.2

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…

1 Like

Hello @pamtbaau,

thanks a lot for sharing. I wasn’t able to care much about this due to ongoing projects.

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.

Thanks and have a nice day!