Posted by jonathan_hunt on May 8, 2012 at 3:17am
3 followers
Jump to:
| Project: | Field Permissions |
| Version: | 7.x-1.0-beta2 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
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] =>
)
Comments
#1
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.
#2
this seems related to #737816: user_role_grant_permissions() throws PDOException when used for a disabled module's permission or with non-existent permissions
#3
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.