Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Clean Installation -> "Deprecated" Error Message

admin

Started by Nico Petri 3 years ago · 6 replies · 935 views
3 years ago

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

Bildschirmfoto 2023-01-25 um 18.59.10|690x368, 75%

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
last edited 01/25/23 by Nico Petri
3 years ago

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

TXT
error_reporting = E_ALL & ~E_DEPRECATED
👍 1
3 years ago

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!

3 years ago

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:

BASH
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

last edited 01/29/23 by Nico Petri
3 years ago

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
last edited 01/29/23 by pamtbaau
3 years ago

Hello @pamtbaau,

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.

Thanks and have a nice day!

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 3 days ago
2 70 5 hours ago
General · by pamtbaau, 10 hours ago
1 45 9 hours ago
General · by Andy Miller, 22 hours ago
0 43 22 hours ago
General · by Marcel, 12 months ago
6 341 4 days ago
General · by Duc , 5 days ago
3 35 5 days ago