Notice: Trying to access array offset on value of type bool

Created on 9 October 2022, about 2 years ago
Updated 25 September 2023, about 1 year ago

PHP 7.4 causes the following notice.

Notice: Trying to access array offset on value of type bool w calendar_plugin_row->render() (line 431 of /sites/all/modules/contrib/calendar/includes/calendar_plugin_row.inc).

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇵🇱Poland saramato

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.

  • Assigned to sagar25
  • 🇺🇸United States nodecode

    Is there any reason a revision as critical as this is still not being pushed to 7.x-3.x branch? Is the 7.x version now on permanent "use the dev version" status?

  • Issue was unassigned.
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇦🇹Austria alexh

    This issue is still in the current dev version from 4 Feb 2021. Only the notice message is slightly different (line 441 instead of 431):

    Notice: Trying to access array offset on value of type bool in calendar_plugin_row->render() (line 441 of /home/icpdrobs/danubis-icpdr-org/sites/all/modules/contrib/calendar/includes/calendar_plugin_row.inc).

    So, the current code still accesses $items[$delta] which is false because the previous call to field_get_items did not get a result. This happens (at least in my case) when there are multiple date fields used in the contextual filter of the View, i.e. a calendar with more than one node type where the names of the date fields are different.
    I used the fix in #5 and it gets away with the notice message and the View display works fine (at least in my case).

Production build 0.71.5 2024