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

Moving a page can cause an error - Call to a member function media() on null #61

Open
CSixtyFour opened this issue May 17, 2018 · 3 comments

Comments

@CSixtyFour
Copy link
Contributor

Hi
I've found that if I move a page in the admin panel it can then crash the page on viewing with the error "Call to a member function media() on null" in seo.php because one (or more) of the screenshot image links is now incorrect.
One quick work around is to store screenshot images in a central "images" folder rather than in the page folder.

@CSixtyFour
Copy link
Contributor Author

I should have mentioned the issue here: line 79

$imgarray = $this->grav['page']->find($fixedurl)->media()->images();

@paulmassen
Copy link
Owner

Hi,

Sorry I'm late to answer.

This is not really a bug, as it is the way Grav is designed, a similar problem with the file field exist:
Here is a link with rhukster's explanation
getgrav/grav-plugin-admin#1446

Hope this helps

@CSixtyFour
Copy link
Contributor Author

Actually after a bit more use I found it was crashing the page even when the image field was blank. The only solution was the disable twitter and/or facebook and then page was usable again.

I think I tracked the issue down to the find function crashing due to the null variables being passed which I guess is really a core Grav issue not your plugin.

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

No branches or pull requests

2 participants