Would it be possible to add field restriction while creating node? Now it seems this exists only for editing and viewing nodes.

Simple use scenario: I have a picture node which contains a date field and an ImageField. However, there are several user roles that I would like to restrict while creating picture nodes. For my use, I would like to have an unlimited size, for other users to set limits lets say to 800x600.
I created 2 ImageField fields. One (unrestricted dimensions) is visible to me, the other one (restricted) is visible to others. In both cases, they are set as "required".

All seems to go fine till the point when I want to submit the node. Then, even though I don't see the other field (the restricted one), I am warned that I have not uploaded a picture (through the field I don't see). It does not seem logical to me that I can set a restriction on editing fields but not on creating them.

Could this be incorporated into CCK the way you can see in the patch attached?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kunago’s picture

Attaching the "patch".

kunago’s picture

One again trying to attach.

kunago’s picture

Since it seems like the only accepted values in hook_field_access by $op are "edit" and "view", should I expect the issue is with the module FileField or ImageField?

If it is the case, could someone please throw this issue into the issue queue of FileField?

kunago’s picture

Assigned: kunago » Unassigned
Category: feature » bug
Status: Active » Closed (fixed)

Since the bug seems to be in the FileField module, I am closing the task.
The followup can be found in the issue queue of FileField (#793042: Required file fields not validated properly when Content permissions hide the field).

Oleksa-1’s picture

sorry,wrong issue