Drupal Association members fund grants that make connections all over the world.
The following scenario is given:
Drupal7, rules 7, content access (beta version) and Postgresql are used.
When a webform is saved rules triggers setting of permissions. At initial saving, this fails. Following error message occurrs:
PDOException: SQLSTATE: Unique violation: 7 errors: Unique-Constraint »node_access_pkey«: INSERT INTO node_access (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( ) in node_access_write_grants() (line 3440 drupal7/modules/node/node.module).
Saving the document without using rules integration and setting permissions later works well.
The patch attached solves this problem.
Cause: Rules integration of content access checks the node operation which initially is 'save'. If this is not the case (such as 'update' it will trigger node_access_acquire_grants($node).
So initially this shoud not happen because of multiple calls of this method (see comment of the integration).
Nevertheless, this happens due the German localization of Drupal is used and the operation is translated, too.
Hence, t('save') has to be compared against instead of 'save'.
Please apply this patch in the upcoming release as quick as possible.
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch content_access_rules.patch. Unable to apply patch. See the log in the details link for more information. View