paulmassen / grav-plugin-seo

Manage your site’s meta tags for display in search engine results or social media networks. Create and manage json-ld microdata. Includes an easy-to-use live preview feature.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

CSixtyFour opened this issue · comments

commented

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.

commented

I should have mentioned the issue here: line 79

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

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

commented

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.