Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Please help me,
After I update from rules 2.4 to 2.5 I received the follow error messages, and the system doesn't work again. Please somebody has any idea who to solve this issue.
I'll appreciate.
Recoverable fatal error: Argument 2 passed to SelectQuery::fields() must be an array, null given, called in /home4/lemdeals/public_html/empleos/includes/entity.inc on line 279 and defined en SelectQuery->fields() (línea 1300 de /home4/lemdeals/public_html/empleos/includes/database/select.inc).
Luis
Comment | File | Size | Author |
---|---|---|---|
#6 | phpunit_run_fix_after_site_install_for_rules_module_v1.0.patch | 1.72 KB | pdenooijer |
Comments
Comment #1
fagoStrange. Which php version are you running? Does no one else experience this?
Comment #2
katannshaw CreditAttribution: katannshaw commentedI received a similar error when trying to create a simple "send email after saving comment" rule with 7.x-2.5:
Recoverable fatal error: Argument 1 passed to RulesEventHandlerEntityBundle::extractFormValues() must be an array, null given, called in \mysite\sites\all\modules\rules\ui\ui.forms.inc on line 485 and defined in RulesEventHandlerEntityBundle->extractFormValues() (line 362 of \mysite\sites\all\modules\rules\includes\rules.event.inc).
I've flushed the caches, ran CRON and ran update.php, but the error still appears. I guess I might try to revert back to a previous version as a temporary fix. I haven't messed with Rules in awhile, which is probably why I just saw this.
Update:
Reverting to 7.x-2.3 made the error go away.
Comment #3
abrlam CreditAttribution: abrlam commentedI think this is a duplicate issue. I filed a similar one (same error as jayhawfan75) a while back.
Drupal 7.22
PHP Version 5.5.9-1ubuntu4.5
Rules 7.x-2.3+20-dev
There's 2 ways to get around this issue:
1. As jayhawfan75 suggested, revert back to 7.x-2.3
2. Make a clone of an existing rule and work from there
Comment #4
pdenooijer CreditAttribution: pdenooijer commentedI encountered this bug as well when having rules enabled when doing a site install and directly after that running my phpunit tests on my custom modules. I use a continuous integration builder, that does a fresh site-install and a couple of test etc to see if my last commit has any common mistakes.
This is the full error (I replace the directory to /project/).
After some digging and debugging I found the cause of the problem. In the class RulesEntityController the following variable entityInfo['schema_fields_sql'] is not set for some reason. Because of this the needed entityInfo['schema_fields_sql']['base table'] can't be used in DrupalDefaultEntityController class. After that the result will be NULL instead of an array that is needed for the SelectQuery->fields() method and PHP will generate a fatal error.
I wrote a patch that checks if entityInfo['schema_fields_sql']['base table'] exist. If not it will throw a new exception, that will be caught in the RulesEventSet::rebuildEventCache() static method. This only happens the first time this method is used, after that the exception is never thrown again.
I hope this helps someone that may encounter the same problem :)!
(Hmm having some trouble uploading and combining comment with patch, could someone fix this for me?)
Comment #5
pdenooijer CreditAttribution: pdenooijer commentedComment #6
pdenooijer CreditAttribution: pdenooijer commentedComment #7
Tezcatlipoca CreditAttribution: Tezcatlipoca commentedpdenooijer Thank you so much for taking the time to create and distribute this patch. Likely saved me hours and hours of work. Worked like a charm. Smoothest patch I've ever applied. :)
Comment #8
dancastellon CreditAttribution: dancastellon commentedPatch from #6 worked for me, thanks!
Comment #9
yazzou CreditAttribution: yazzou commentedHello
I am using the latest version of rules (7.x-2.9) , here is what i get when i enable rules_admin.
Catchable fatal error: Argument 2 passed to SelectQuery::fields() must be of the type array, null given, called in /data/all/000/core/drupal-7.37.1/includes/entity.inc on line 317 and defined in /data/all/000/core/drupal-7.37.1/includes/database/select.inc on line 1301
when applying the patch i get this :
Warning: Invalid argument supplied for foreach() in /data/disk/path/distro/003/drupal-7.37.1-prod/sites/medbug.subsite.fr/modules/entity/includes/entity.controller.inc on line 259
Comment #10
yazzou CreditAttribution: yazzou commentedIs there any solution ? I have relied on rules_admin to set the rules of my site and it is critical for me
Comment #11
pdenooijer CreditAttribution: pdenooijer commented*nvm*
Comment #12
yazzou CreditAttribution: yazzou commentedwhat do you mean ?
Comment #13
pdenooijer CreditAttribution: pdenooijer commentedDoes it work with the patch or not? As warnings should not happen but are not the end of the world.
Comment #14
yazzou CreditAttribution: yazzou commentedNo it does not work with the patch as i do have the warning as i have WSOD
Comment #15
kenorb CreditAttribution: kenorb commentedComment #16
pownraj CreditAttribution: pownraj as a volunteer commentedI'm also getting the same error after upgrading the php from php5 to php7
Comment #17
jennypanighetti CreditAttribution: jennypanighetti commentedI applied this patch today and went from seeing the error message on my screen to a WSOD with no errors in the log.
I'm on Drupal 7.58 and PHP 5.6.32.
Comment #18
TR CreditAttribution: TR commented@pownraj: OK, so you get the same error as the original post. But does the patch fix the problem? If not, then what errors do you get after you apply the patch?
@jenstechs: No errors in your webserver error log? Difficult to track down a problem on someone else's website without an error message. And this doesn't happen on the vast majority of sites since the last post here was a year ago...
Comment #19
TR CreditAttribution: TR commentedNote that I just re-ran the tests on #6, and the patch still applies to 7.x-2.x and the tests still pass.
This means that nothing the tests do cause this error to show up - otherwise the tests would fail.
So for those of you who need a solution, you need to provide a sequence of steps we can follow to reproduce the error. Because this could be related to other modules you have installed, or your server configuration, or your database type, or your PHP version, or how you've configured caching on your site, etc., it's impossible for the rest of us to guess where the problem may lie unless you provide details. The most useful thing would be to use simplytest.me and set up a site and figure out how to reproduce the error on that site.
Comment #20
TR CreditAttribution: TR commentedNo further information provided. Feel free to reopen the issue if you can provide detailed steps to reproduce the issue on a clean site.