Notice: Trying to access array offset on value of type bool in og_context_determine_context()

Created on 30 September 2020, about 4 years ago
Updated 18 May 2023, over 1 year ago

Problem/Motivation

It is possible that $item = menu_get_item(); returns false when no object can be loaded in _menu_translate.

Therefore if (strpos($item['path'], $path) === 0) { will throw a notice when running on php 7.4

"Notice: Trying to access array offset on value of type bool in og_context_determine_context() (regel 427 van /var/www/web/sites/all/modules/contrib/og/og_context/og_context.module)."

🐛 Bug report
Status

Fixed

Version

2.0

Component

og-context

Created by

🇳🇱Netherlands undersound3

Live updates comments and jobs are added and updated live.
  • PHP 7.4

    The issue particularly affects sites running on PHP version 7.4.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom robcarr Perthshire, Scotland

    I'm seeing the problem on PHP8.1 - patch works (which is in dev release), but still isn't in formal release of OG

Production build 0.71.5 2024