-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Call to a member function metadata() on null #66
Comments
Are you on 1.0.0-rc.1? |
"tobimori/kirby-seo": "1.0.0-rc.1" |
Interesting, I had the same error and fixed it in rc.1 - but it seems I didn't catch all edge cases. Why this error happens: In rc.1, I fixed that draft pages could also be found. Is there anything special about this page or your environment that might lead to this issue? Can you share the request URLs from the network tab? |
$kirby->request()->path()->data()[2] |
i assume it's related to running on a subfolder then, will check |
Hi, Tobias. Any update on this issue? I'm getting the same problem with 1.0.0-rc.2 in a localhost installation and a public-facing UAT environment. Both of them run in subfolders. Thanks. |
I could not reproduce this so far with my setup, have to try something else |
For what it's worth, I've still got a previous version of the plugin that was just called 1.0.0 – no 'rc' release reference. With that version, the Robots blueprint section worked OK within seo/page. But it wasn't generating a sitemap. With 1.0.0-rc.2, the sitemap generation works but, because of the issue with the Robots section in the blueprint, it is empty. |
I think it can easily be solved by just grabbing the last part of
|
Have you tested it? I had the assumption that Kirby fires multiple API requests sometimes (like lock, or section APIs, etc.) and then a subsequent request wouldn't work. |
Hi, this should be fixed here: 36d0538 Would appreciate if this actually fixes your issue by testing the mainbranch before I release it! Thanks :) |
@tobimori Yes, this works for me, great |
Just released it as 1.0.0-rc.3 then. |
This is actually not working when page kirby-seo/blueprints/fields/robots.php Line 24 in c9e42c5
I would modify this line to: $matches = Str::match($path, "/pages\/([a-zA-Z0-9-_+]+)\/?/m"); |
you're right, completely forgot that! thanks. |
Hello tobimori, |
Is the page you're trying to access a draft? It seems like there's a Kirby bug in that case. |
No, it is not a draft page. It is a product page that already existed before the plugin was installed. |
Is any page in the chain a draft? I can only reproduce it that way |
No, no drafts in the path. |
okay, let me know if you have anything else that might help in reproducing this error. |
Sorry. That was my mistake. No more metadata() equal null. |
Hello Tobias, |
As said, this error is from Kirby core and I'll wait for a fix from them |
Might be a good idea to remove the |
You can disable the robots page settings using your config and the robots index will still follow the page status. |
1.0.0 should fix the error. |
I added seo/page to the page blueprint (also added the seo/site to the site blueprint), and it gives the error Call to a member function metadata() on null. the element with the error:
The text was updated successfully, but these errors were encountered: