If a conditional field is required and the user doesn't type anything in and submits, the title prints back with the asterisk appended to it in the error message.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fix_required_display.patch | 2.3 KB | threexk |
If a conditional field is required and the user doesn't type anything in and submits, the title prints back with the asterisk appended to it in the error message.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | fix_required_display.patch | 2.3 KB | threexk |
Comments
Comment #1
bsuttis commentedTitle typo =/
Comment #2
threexk commentedI started to look into this, and it appears the '*' was intentionally put in the wrong place because there was no simple way to put it in the right place. (Required conditional fields are not actually set to required when they are given to Drupal to render, yet Drupal normally inserts the asterisk depending on whether the field is set to required.)
Comment #3
peterpoe commented@threexk: Correct. The asterisk is put there by theme_form_element in forms.inc
I didn't want to override just to move the asterisk. Now that conditional fields are passed through a custom theme function (theme_conditional_fields_form_item), I guess that we could work there...
Comment #4
threexk commentedHere's a patch using theme_conditional_fields_form_item() per your suggestion, peterpoe. It sets #required for all fields with #required_field just prior to drupal_render(). That way, Drupal renders them like it would any other required field.
I don't think you'd ever want required conditional fields to look different than a normal required field, so I removed theme_conditional_field_required_title(). (This was mainly duplicated code from core anyway.)
Comment #5
peterpoe commentedTested and seems to work fine... Adding to cvs.
Comment #6
peterpoe commentedComment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.