Skip to content
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

TypeError when switching to PHP8 #3368

Closed
onetrev opened this issue May 22, 2021 · 2 comments
Closed

TypeError when switching to PHP8 #3368

onetrev opened this issue May 22, 2021 · 2 comments
Assignees

Comments

@onetrev
Copy link

onetrev commented May 22, 2021

I just tried moving my Grav 1.7.15 from PHP 7.4 to PHP8, and upon doing so I get the following error in /system/src/Grav/Common/Themes.php

"method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given"

Anything I can do to fix this, or if not help troubleshoot this further? Thank you!

NOTE: I just created a new Grav site on the same server, it's running on PHP 8 too, and all is good with that site.

@mahagr
Copy link
Member

mahagr commented May 22, 2021

It must be theme specific error. Nonetheless, I think there's room to improve the checks.

@onetrev
Copy link
Author

onetrev commented May 23, 2021

Excellent. Ya, this would be great because right now I can't see any info in there that gives me any indication it was my theme that way the problem, sorry, and more importantly I can't see where my error is. :( So that's going to be tricky to troubleshoot.

PS, love the work you guys are doing. I have the NextGen Editor running my custom theme (that is broken in PHP 8). And I just picked up Typhoon for my wife's site.

UPDATE: fixed! The issue was that in mytheme.php (clgrav.php in my case) the theme name in class MyTheme extends Theme was not the correct name. Used to work in PHP 7 but I guess PHP 8 is more picky. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants