I'm saving rules in a feature. I added a new rule that has as dependency a module that I added to the project's repo. This new module was correctly added to the feature's dependency list in the .info file.

The problem occurred when I tried to deploy the changes to a new server. My usual deployment routine goes like this:

drush fr-all -y
drush updb -y
drush cc all

The deployment choked on drush cc all saying:

WD php: PDOException: SQLSTATE[HY000]: General error: 1364 Field 'plugin' doesn't have a default value: INSERT INTO {rules_config} (name, status, module) VALUES (:db_insert_placeholder_0, [error] :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => rules_new_report [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => checkdesk_core_feature )

I was able to fix this error by enabling the new module manually before running drush cc all. This is not a good solution as I don't want to change my deployment routine for arbitrary deployments.

I think I traced the problem to Entity API's hook_flush_caches being called before Features'. In this function, Entity API ends up reloading the default rules, which fails because the new module which is listed as a dependency of the feature hasn't been enabled yet. It will only be enabled when Features' hook_flush_caches runs. I tried to mess with module weights but without success.

Any idea for a robust solution to this?

  • What versions of the modules are you using? Also, why are you posting this here rather than in Entity's issue queue? – Patrick Kenny Sep 30 '12 at 4:57
  • I'm using Entity API 7.x-1.0-rc3, Rules 7.x-2.2, Features 7.x-1.0. – infojunkie Sep 30 '12 at 5:00
  • I've posted here because I'm not even sure whose problem it is. – infojunkie Sep 30 '12 at 5:00
  • Submitted support request against Entity API: drupal.org/node/1799666 – infojunkie Oct 1 '12 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.