Pointed by plach in #629252-8: field_attach_form() should make available all field translations on submit:
When user has no 'edit access' for a field edits a node and creates a new revision, the field revision data is not properly created.

Attached patch is test that demonstrates the bug (should fail).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

FileSize
16.99 KB

And that patch is test + fix (should pass).
Includes the field values as '#type' => 'value' elements in the form.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Awesome.

+++ modules/simpletest/tests/field_test.module	19 Nov 2009 01:01:54 -0000
@@ -49,6 +49,15 @@ function field_test_menu() {
+function field_test_field_access($op, $field, $obj_type, $object, $account) {
+  if ($field['field_name'] == "field_no_{$op}_access") {
+    return FALSE;
+  }
+  return TRUE;
+}

So this is 90% of CCK field permissions in a core test module? Yay!? X-D

This review is powered by Dreditor.

yched’s picture

FileSize
17.04 KB

Minor change, unify the form structures a little more between 'access' and 'no access'.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Good clean-up and even comes with a full suite of delicious tests. Yummy!

Committed to HEAD.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.