We have a site with the content_permissions module. Some users can't therefore access some fields. Now the content manager writes:
If an item has required data fields that are not populated with values, then that item cannot be deleted until those required values are populated. This arises in the case that a required field is not visible to the user who created the item due to permissions. So do you know of a way to suppress the requirement that all required fields be populated before an item can be deleted?
I myself do not have an answer to this, but it sounds like a good question to me. :)
Any ideas?
Thanks.
Quoting Fred Jones fredthejonester@gmail.com:
We have a site with the content_permissions module. Some users can't therefore access some fields. Now the content manager writes:
If an item has required data fields that are not populated with values, then that item cannot be deleted until those required values are populated. This arises in the case that a required field is not visible to the user who created the item due to permissions. So do you know of a way to suppress the requirement that all required fields be populated before an item can be deleted?
I myself do not have an answer to this, but it sounds like a good question to me. :)
Any ideas?
In your foo.module you use a hook_form_alter to set the [#required] to false.
-- Earnie -- http://r-feed.com/ -- http://for-my-kids.com/ -- http://www.4offer.biz/ -- http://give-me-an-offer.com/
Is it possible to use hook_form_alter in templates?
On Thu, Aug 13, 2009 at 11:46 PM, Fred Jones fredthejonester@gmail.comwrote:
In your foo.module you use a hook_form_alter to set the [#required] to false.
So that would be the only way? A custom module?
[ Drupal support list | http://lists.drupal.org/ ]
I see, thanks for the reply Fred.
On Fri, Aug 14, 2009 at 3:01 PM, Fred Jones fredthejonester@gmail.comwrote:
Is it possible to use hook_form_alter in templates?
No, it must be in a module. I tried this in a module and it works fine.
Thanks, Earnie.
[ Drupal support list | http://lists.drupal.org/ ]
I don't thinks so, but am not 100% sure. What I do when I need this kind of integration is I do develop a small custom module that goes with me theme to provide the hooks that I need. Then, if I need infromation passed to the theme, I call those functions int he theme variables hook in template.php within the theme. You can get some pretty slick integegrationi between the module and theme layers going that way.
Don't be too worried about creating a custom module. It really only takes making an .info file (with a few lines) and a single .module file with just the one hook_form_alter function in it. There's nothing else required.
________________________________
From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Alexander Arul Sent: Thursday, August 13, 2009 6:52 PM To: support@drupal.org Subject: Re: [support] Chicken/Egg Problem with CCK Field Permissions
Is it possible to use hook_form_alter in templates?
On Thu, Aug 13, 2009 at 11:46 PM, Fred Jones fredthejonester@gmail.com wrote:
> In your foo.module you use a hook_form_alter to set the [#required] to > false. So that would be the only way? A custom module? -- [ Drupal support list | http://lists.drupal.org/ ]