0

Use Case:

On Page A (Content Type A), there is a select list with options A and B

1st Rule for Choice A

User selects A, and a field "Date You Chose Letter" (a date field) captures the current DateTime.

2nd Rule for Choice B

User selects B, and the same field "Date You Chose Letter" (a date field) captures the current DateTime.

Easy enough.

But, when the User returns to Page A, makes some changes (and assume "A" is still selected) the 1st Rule triggers again, updating the "Date You Chose Letter" field with a new current Date/Time

The goal: Do not update the "Date You Chose Letter" field after the initial selection. So I need to set in stone.

1 Answer 1

0

You can write a small custom module to lock down the original value of the field on edit, probably using hook_form_FORM_ID_alter would be the clearest way.

Difference between create new and edit node in form alter provides a decent example, try that. Basically, you have to check in the $form object for an existing node. If it's an edit form, you have a node id already; if it's a new node, you don't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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