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
Comment | File | Size | Author |
---|---|---|---|
#25 | rules-RulesEventSet-1541888-25.patch | 501 bytes | ckng |
| |||
#15 | rules-2.7-RulesEventSet-1541888-15-do-not-test.patch | 442 bytes | davidrobinson_pw |
#15 | rules-RulesEventSet-1541888-15.patch | 462 bytes | davidrobinson_pw |
#10 | 1541888-rules-RulesEventSet-10.patch | 441 bytes | hefox |
Comments
Comment #1
ridgek CreditAttribution: ridgek commentedI have the same issue on 7.x-2.1? Interestingly, this didn't appear until after I migrated my Drupal install to a new server (which has an identical configuration).
Comment #2
pixelsweatshop CreditAttribution: pixelsweatshop commentedJust had the similar situation to ridgekuhn. Moved servers, started throwing errors.
Flushing cache once cleared it up.
Comment #3
ridgek CreditAttribution: ridgek commentedSorry, forgot to update! The errors went away for me, I believe flushing the cache as nicoz recommends is what did the trick, but it's been a few days.
Comment #4
pixelsweatshop CreditAttribution: pixelsweatshop commentedGoing to close. Reopen if issue persists.
Comment #5
deminyWell, I don't think you should close this issue out. I flush caches pretty often and I know the issue could gone for a while once cache was flushed; however, the same issue happens again later on.
Flushing cache could be just a temporary solution, but we can't just sit in front of our PCs and click the 'clear cache' from time to time.
Set ticket status to active.
Comment #6
pixelsweatshop CreditAttribution: pixelsweatshop commentedSince clearing cache, the issue has not returned for me. If it still doesn't work for you, then, as per my previous post. Reopen it. I don't need the lecture. thanks.
Comment #7
Tribal CreditAttribution: Tribal commentedWe had also been experiencing this problem.
We discovered that if the Rules cache was empty we were unable to clear the cache. We had the following error:
Error: Class 'RulesEventSet' not found in sites/all/modules/contrib/rules/rules.module, line 257
After commenting out this line clearing the cache was successful.
We then tested clearing the cache with this line uncommented again and it was successful, suggesting that after the rules cache had been "filled" we were able to clear the caches.
Clearing the cache isn't fixing this issue, just hiding it.
Comment #8
specky_rum CreditAttribution: specky_rum commentedHave just seen the error mentioned in #7 from a fresh D7.14 install. I installed a whole load of modules all at the same time and got that error and wasn't able to recover from it. Commenting the offending line just moved the error to further down the code.
I have since followed exactly the same procedure again and had no problem however. Perhaps not much help but I wonder if it may be to do with the order in which the modules are enabled? The complete list of modules enabled was as follows:
Administration menu, Administration menu Toolbar style, CCK, Field UI, Field, Field SQL storage, Chaos tools, Custom content panes, Date, Date API, Date All Day, Date Popup, Date Repeat API, Date Repeat Field, Date Validation, Date Views, Views, Display suite, Extras, Forms, Entity API, Entity tokens, Features, Field Validation, Libraries, Module filter, Page manager, Panels, Panels In-Place Editor, Mini panels, Panel nodes, Pathauto, Path, Token, Rules, Rules UI, Rules Scheduler, Search API, Views Bulk Operations, Views content panes, Views UI
Comment #9
hefox CreditAttribution: hefox commented#7 error
#1515962: Class 'RulesEventSet' not found
#1552382: Fatal error: Class 'RulesEventSet' not found
http://drupal.org/node/1816472
#1704520: Fatal error: Class 'RulesEventSet' not found in
...among others.
Expierncing it also, not sure if related to original reported issue
Comment #10
hefox CreditAttribution: hefox commentedrules_watchdog is what causing the error. Considering how watchdog can be called very early due to errors, it seems reasonable it's been called before the file RulesEventSet is in has been added, and better to just skip rebuilding cache than causing this error imo.
Comment #11
raghu125coorg CreditAttribution: raghu125coorg commented#10: 1541888-rules-RulesEventSet-10.patch queued for re-testing.
Comment #12
fagoSounds reasonable, but the hunk right now makes that very difficult to see. Can we detect this in hook_watchdog instead and bail out if rules is not fully loaded yet?
Comment #13
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedpatch no longer applies
Comment #14
strawman CreditAttribution: strawman commentedWell it still applies apparently as I just had to use it on my fresh install for Rules 2.7
So thank you for the patch :)
Comment #15
davidrobinson_pw CreditAttribution: davidrobinson_pw commentedI've rerolled Hefox's Patch against the current state of the 7.x-2.x branch
I've also added a version which applies against the 7.x-2.7 release.
Comment #16
jerry CreditAttribution: jerry commentedThe patch for 2.7 resolved this problem for me, which appeared when I installed the References Integrity sandbox module.
Comment #17
sfyn CreditAttribution: sfyn commentedI am now running this patch on our production site with rules 2.7
Flagging rtbc
Comment #18
klausiLooks like fago's comment has not been addressed from #12.
Comment #19
TheBarnacle CreditAttribution: TheBarnacle commentedAre there any plans to add this patch to the main branch? The current dev branch doesn't seem to have it.
Comment #20
Michael-IDA CreditAttribution: Michael-IDA commented2015, still coming up :(
Warning: Illegal offset type in isset or empty in RulesEventSet::rebuildEventCache() (line 716 of sites/all/modules/rules/includes/rules.plugins.inc).
Rules (rules) Module Enabled 7.x-2.3
:Edit 01:
Maybe it's significantly worse now . ? . ? .
Went to the Rules config page (/admin/config/workflow/rules) and got this:
:Edit 02:
Seems caused by Commerce License Billing, https://www.drupal.org/node/2631008
But should rules crash and burn because of bad data being passed to it?
Comment #21
stranger27 CreditAttribution: stranger27 commentedSolution #15 works! Thanks!
Comment #22
Michael-IDA CreditAttribution: Michael-IDA commented#15 doesn't address #12.
Does suck that this bug has been open 4 years.
Comment #23
Pimmy CreditAttribution: Pimmy commented#15 worked for 7.x-2.9, although the line numbers were different.
Comment #24
TR CreditAttribution: TR commentedMarked #2275963: Fatal error: Class 'RulesEventSet' not found in /sites/all/modules/rules/rules.module on line 391 as a duplicate.
Comment #25
ckngReroll #15 for dev.
Comment #26
TR CreditAttribution: TR commented@fago's concern from #12 has still not been addressed.
Comment #27
MiroslavBanov CreditAttribution: MiroslavBanov as a volunteer commentedPatch number #25 doesn't fix the problem for me. I also agree with #12 and #26, and seem to have the same problem.