It's not always safe to make assumptions about the page that the node form is appearing on. When you look for ( arg(0) == 'node') && arg(1) == 'edit'); you are abandoning the possibility that the edit form might be getting called by another form or on another page.

Also, because the form_id is not getting checked, this form_alter code is being executed in its entirety for every form on the site.

The attached patch addresses both issues. Please check it out and get back with questions.

Thanks!

CommentFileSizeAuthor
#1 cck_field_perms_0.patch807 bytesAllie Micka
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Allie Micka’s picture

FileSize
807 bytes

validation ate my patch!

arthurf’s picture

Status: Needs review » Fixed

Thanks for the patch. Submitted for both 4.7 and 5.0

Anonymous’s picture

Status: Fixed » Closed (fixed)