Closed olafgrabienski closed 1 year ago
Thanks @olafgrabienski. This looks like a correct fix, as menu_get_item()
can return FALSE when there are problems getting the menu item from the database. I'll be happy to merge this fix.
As a side note, this may be a sign of problems in your upgraded site in core, that are beyond the OG functionality - so if you can find a way to reproduce this may help troubleshoot site upgrading issues. Given the place where this warning is happening (after menu_get_item()
the quickest way to figure out the problem is by examining the stack of calls when $item
is empty.
This is happening when entityreference_prepopulate is enable and you get a "Page not found". Similar situation as #135. PR coming.
PR #143
Sorry for being late, and thanks for the explanation and the PR! I've just verified on a OG powered site with Entityreference Prepopulate that the PR fixes the issue: no PHP notice anymore when there is a "Page not found".
Since https://github.com/backdrop-contrib/og/releases/tag/1.x-2.10.0-beta there were some issues fixed, and most things are working fine now. What do you think about a new release?
Let's do it!
Should we merge #134 too?
Sure, if you're okay with the caveat mentioned in https://github.com/backdrop-contrib/og/issues/26#issuecomment-1497998534.
Release 1.x-2.10.1 is out! We'll need to update the repo for localize at some point...
The full PHP notice is:
So far I can't tell how exactly to reproduce the issue. I see many of these notices in DBlog on a site which is an upgrade from D7. Code-wise, line 497 reminds the recently fixed issue https://github.com/backdrop-contrib/og/issues/135. So, a fix could maybe look like this:
if (strpos($item['path'], 'node/add/') !== 0) {
if ($item && strpos($item['path'], 'node/add/') !== 0) {
But first, I'd like to be able to know the steps to reproduce the issue.