PHP warnings when calling method RulesEventSet::rebuildEventCache()

Created on 21 April 2012, almost 13 years ago
Updated 9 February 2025, about 2 months ago

Since upgraded to Rules 7.x-2.1+2-dev (2012-Apr-02), I constantly got PHP warnings like following

Warning: array_diff_key() [function.array-diff-key]: Argument #1 is not an array in RulesEventSet::rebuildEventCache() (line 750 of sites/all/modules/rules/includes/rules.plugins.inc).
Warning: array_keys() [function.array-keys]: The first argument should be an array in RulesEventSet::rebuildEventCache() (line 750 of sites/all/modules/rules/includes/rules.plugins.inc).
Warning: array_flip() [function.array-flip]: The argument should be an array in RulesEventSet::rebuildEventCache() (line 751 of sites/all/modules/rules/includes/rules.plugins.inc).

This module is used by module Entity tokens and Entity API on my sites.

The first argument is $events, which is initialized by calling "$events = rules_fetch_data('event_info');". What I'm thinking is, in case variable $events is initialized with a NULL value (or a non-array value that indicates there no data for it), and there is no rules set up, function call "array_diff_key($events, $sets)" on line 750 won't work. I don't know much about this module, so this is just my guess.

Anyway, since the bug annoy me a lot, I'm going to downgrade to 7.x-2.1.

Thanks

πŸ› Bug report
Status

Closed: outdated

Version

2.0

Component

Rules Core

Created by

πŸ‡¨πŸ‡¦Canada deminy Canada

Live updates comments and jobs are added and updated live.
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 States tr Cascadia

    Drupal 7 is no longer supported.

    The root cause of this problem with class loading in systems (both PHP and Drupal) that were not really designed for object-oriented programming. But the class loader in PHP and Drupal has been considerably overhauled in newer versions of PHP and Drupal, and we no longer experience any problems like this.

Production build 0.71.5 2024