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

CommentFileSizeAuthor
feature-rules-import-doesnt-work.jpg136.73 KBviktor.boykiv

Comments

avpaderno’s picture

Title: Feature Rules creation doesn't work » Feature rules creation doesn't work
Issue tags: -Entity system, -rules, -features
james.williams’s picture

Rules 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.

fago’s picture

Title: Feature rules creation doesn't work » Generated feature modules doesn't work
Project: Features » Rules
Version: 7.x-1.0-alpha3 » 7.x-2.x-dev
Component: Code » Feature module support
Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Moving 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.

avpaderno’s picture

Title: Generated feature modules doesn't work » Generated feature modules don't work
klausi’s picture

Component: Feature module support » Rules Engine
Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closed since no further information has been provided. Reopen if still an issue.

vinoth.3v’s picture

Component: Rules Engine » Rules Core
Status: Closed (cannot reproduce) » Active

Issue still exists with latest Rules module.

bropp’s picture

I 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.

sagannotcarl’s picture

Status: Active » Closed (duplicate)

I 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.