form_set_error issues

scott.mclewin - July 22, 2006 - 20:16
Project:Event Repeat
Version:4.7.x-2.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

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

Sean B Fuller - December 5, 2006 - 15:23
Title:form_set_error in _eventrepeat_validate_form_date() references non-existant form field» form_set_error issues

I think there are probably several form_set_error issues that we need to resolve.

#2

Sean B Fuller - January 5, 2007 - 20:01
Version:HEAD» 4.7.x-2.x-dev

#3

rmiddle - January 12, 2009 - 13:53
Status:active» fixed

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

System Message - January 26, 2009 - 14:00
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.