form_set_error issues
| Project: | Event Repeat |
| Version: | 4.7.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
I hope you don't think I'm just trying to fill your issue queue with minor items. I'd rather report little problems as I see them than just let them lie - I'd want the same thing from others on the module I maintain.
Unless this is a piece of Drupal magic that I've not yet understood, I believe this form_set_error call is not going to have all of the desired effect. The field being passed in, eventrepeat_endmonth, is not a field on the form. It is a field in the node itself loaded in eventrepeat_nodeapi(). Unless the forms API is clever enough to map a node member field to the forms somehow (I really don't think so....), then I believe this call will set an error as desired, but won't set focus to the date field that caused the error.
form_set_error('eventrepeat_endmonth', t('You have selected a date that is before or the same as the start of the selected event,
which is not allowed--check your repeat pattern settings and try again. <br> Note: If you are trying to shorten
the end date of a repeat cycle, perform that operation from an event date before the new end date.'));I beleive putting $prefix here instead will do what you want (or $prefix.'month' if FAPI needs a leaf node to set focus on). Same caveat as my other issues in the past few days: this is from reading only, not from debugging. I may be wrong. Feel free to tell me to stop reporting issues below a certain scope if you don't see this as helpful.

#1
I think there are probably several form_set_error issues that we need to resolve.
#2
#3
4.7 Branch is being moved to unsupported. If this is still an issue with 5.1 or 5.2 please reopen.
Thanks
Robert
#4
Automatically closed -- issue fixed for two weeks with no activity.