If I define a field (on a user) and associated permissions in a feature, then deploy the feature, when I try to revert the target site to the new feature state, the revert fails due to field_permissions not populating the database placeholders

Do you really want to revert user_permission? (y/n): y
WD php: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission}  [error]
(rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array
    [:db_insert_placeholder_0] => 3
    [:db_insert_placeholder_1] => create field_builder_customer_margin
    [:db_insert_placeholder_2] =>


alphageekboy’s picture

This is most likely because when you edit content types to add the custom permission the field_update_field function is called which adds

"field_permissions";a:1:{s:4:"type";s:1:"2" to the data field in the field_config table with 'type' representing the field_permissions options selected for that particular field.

Thus, when you try to deploy the feature you need to also insure that the content type changes are deployed either in a separate feature or you package the content type up in your current feature.

I am running into the same issue as this affects 13 content types for me and now need to go and update ~13 features.

Hope this helps.

jackbravo’s picture

Status:Active» Closed (duplicate)

And this one is also related: #1901636: Importing a disabled format that is assigned to a role causes a fatal.

So I think this is a dup.