When adding an event that spans two days and then adding a timeslot for the first day and then the second day, the events dashboard page throws the following error:

Notice: Undefined index: cod_events_timeslots_16_form in drupal_retrieve_form() (line 763 of /var/www/d4d2013.localhost/includes/form.inc).
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'cod_events_timeslots_16_form' not found or invalid function name in drupal_retrieve_form() (line 798 of /var/www/d4d2013.localhost/includes/form.inc).
Notice: Undefined index: cod_events_timeslots_15_form in drupal_retrieve_form() (line 763 of /var/www/d4d2013.localhost/includes/form.inc).
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'cod_events_timeslots_15_form' not found or invalid function name in drupal_retrieve_form() (line 798 of /var/www/d4d2013.localhost/includes/form.inc).

Removing one event on Day 1/2 and re-adding it to Day 1/2 results in the same error. Truncating cache_bootstrap fixes the issue. It appears that D7 caches all of its hook implementation and thus it appears cod_events_forms() is not run on addition of the second timeslot when viewing the Events Dashboard page/pane in cod_events.pane.inc. It may have something to do with http://drupal.org/node/648680, but not sure. Is there a way to force forms rebuild upon adding a second slot on a second day?

Comments

danielshields’s picture

In the cod_events_pane.inc file, this line seems to be causing the problem:

drupal_get_form('cod_events_timeslots_'.$day.'_form', $event, date_format_date($date, 'custom', 'Y-m-d')),

After doing some digging, it appears that if you change it to the actual form function name it gets rid of the errors. Have you found any other solutions for this?
drupal_get_form('cod_events_timeslots_form', $event, date_format_date($date, 'custom', 'Y-m-d')),

henrikakselsen’s picture

StatusFileSize
new607 bytes

Yes, #1 seems to work, created a patch for it here.

japerry’s picture

Status: Active » Fixed

Fixed and not relevant with the new scheduler table system.

Status: Fixed » Closed (fixed)

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