I do the following:
1. Create a simple rule (Rule). For example, after updating existing content (Content types: article) we do Publish content.
2. Next export this Rule via Features into the new module (but do not install it right after that).
3. At the next step we delete the newly created Rule.
4. Install previously created Rule Features module.
And then we get the following error:
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, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => rules_article_publish [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => article_rules ) in drupal_write_record()
As far as I understood, the problem is in the Rules Export plugin, because not all the data is being exported into the features module (plugin and data is empty). That’s why we get such error during importing (when turning on the features module) and the rules doesn’t import properly.
Please, see attached feature-rules-import-doesnt-work.jpg
Using: Drupal 7.0, Features 7.x-1.0-alpha3, Entity 7.x-1.x-dev, Rules 7.x-2.x-dev
| Comment | File | Size | Author |
|---|---|---|---|
| feature-rules-import-doesnt-work.jpg | 136.73 KB | viktor.boykiv |
Comments
Comment #1
avpadernoComment #2
james.williamsRules module itself seems to lack this default value for the plugin field - so I've filed #1046250: Plugin field in hook_schema lacks default value against Rules.
Comment #3
fagoMoving to Rules, as most likely this is a problem with the features integration of Rules. How does the exported Rule look like in the feature? Is the export from the Rules UI different?
Also please try whether upgrading to features-dev helps, as I've only tested it with that version so far.
Comment #4
avpadernoComment #5
klausiClosed since no further information has been provided. Reopen if still an issue.
Comment #6
vinoth.3v commentedIssue still exists with latest Rules module.
Comment #7
bropp commentedI received this error and eventually tracked it down to the default rules configuration returning false from my feature because the required modules were not present. The entity was then just filled with defaults from the entity module when it attempted to save it to the database. The rules feature export did not add the requirements as dependencies on the feature module itself.
Comment #8
sagannotcarl commentedI was having a similar problem (as described in #1779782: Problems exporting to features with Entity API rc1). My problem was solved by updating the the most recent stable version of Entity API. Try updating and see if that fixes it for you. Marking this issue a duplicate of #1779782: Problems exporting to features with Entity API rc1.