0

I have a field (selectbox) that is configured to not be shown (no 'view' permission) on a particular role, nor not to be edited (no 'edit' permission) by the same role. This role is only able to edit other fields. So normally, when this role edits the content, he should not see this particular field. But I want this field to automatically get updated via 'Triggered Rules'. I don't want anyone able to see this field in the first place. For example:

Price Range Field:

  • Lowest to 1M
  • Between 1M to 5M
  • Between 5M to 10M
  • Greater than 10M

This is my set up so I could use this in exposed filter views to filter price ranges.

When that role enters some price in 'field_price', a trigger updates the price range field.

I do not have a problem with creating a new content, the price range gets filled out properly. However, when editing this content, I get this error 'Price Range: Illegal value'. When I make this field permissible for this role, this field gets updated properly.

I'm quite sure there is a way to this without doing any complicated stuffs.

Thanks in advance!

1

I would use a Computed Field for this purpose, then you can define in PHP how to populate it.
Or you can populate it with a hook_nodeapi submit.

  • I have a lot of modules installed already so I have to choose some solution where I don't need to install modules especially for small things like this. With this the problem was when you set 'no permission to edit' a particular field it will not show up on the mark up, when in fact it should be since 'triggered rules' are using it to be modified. In my case the work-around was to make this hidden, but since this is a select box simply making this to type => 'hidden' would not also work but this i find: $form['field_price_range'] = array('#attributes'=>array('visibility:hidden')); works! – jan Jul 26 '11 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.