Undefined variable: hours
  • I haven't added a new show for a while and didn't spot this problem until today, and it had me so frustrated that I event purged and reinstalled airtime and postgres, began clean, and it's still failing:

    When I create a new show, with "record and rebroadcast", fill the details, and save it, seems like it isn't passing the hours variable to the PHP, it doesn't show any errors on the web admin, but the show isn't added to the schedule and gives me this error on the logs:

    2014-04-07T21:08:31+02:00 INFO (6): [ScheduleController.php : eventFeedPreloadAction() : line 139] - agendaWeek
    2014-04-07T21:13:42+02:00 INFO (6): [index.php : () : line 71] - Undefined variable: hours
    2014-04-07T21:13:42+02:00 INFO (6): [index.php : () : line 73] - #0 /usr/share/airtime/application/forms/AddShowWhen.php(266): exception_error_handler(8, 'Undefined varia...', '/usr/share/airt...', 266, Array)
    #1 /usr/share/airtime/application/forms/AddShowWhen.php(103): Application_Form_AddShowWhen->checkReliantFields(Array, true, NULL, false, NULL)
    #2 /usr/share/airtime/application/services/ShowFormService.php(445): Application_Form_AddShowWhen->isWhenFormValid(Array, true, NULL, false, NULL)
    #3 /usr/share/airtime/application/controllers/ScheduleController.php(533): Application_Service_ShowFormService->validateShowForms(Array, Array)
    #4 /usr/share/php/libzend-framework-php/Zend/Controller/Action.php(516): ScheduleController->addShowAction()
    #5 /usr/share/php/libzend-framework-php/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('addShowAction')
    #6 /usr/share/php/libzend-framework-php/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
    #7 /usr/share/php/libzend-framework-php/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
    #8 /usr/share/php/libzend-framework-php/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
    #9 /usr/share/airtime/public/index.php(64): Zend_Application->run()
    #10 {main}

    Any help on this?

    I'm using v 2.5.1-1, on Ubuntu 12.04, i386.

    Thanks!
  • 6 Comments sorted by
  • I did a pastebin of that part of the log, just in case:

    http://pastebin.com/raw.php?i=8synkczb
  • I'm having exactly the same problem.  Any fixes for this?  It is literally a show stopper!

    Using 2.5.1 on Ubuntu 13.10, i386


  • Hi guys,

    I've created There is a ticket in the airtime issue tracker for this - you can follow (and vote on it) at http://dev.sourcefabric.org/browse/CC-5801 http://dev.sourcefabric.org/browse/CC-5784

    thanks for reporting,

    Steven
    Post edited by Steven McPhillips at 2014-04-22 18:28:09
  • To get it working in the mean time I copied the following back into the function checkReliantFields:

             $pattern =  '/([0-9][0-9])h ([0-9][0-9])m/';
             
            if (preg_match($pattern, $formData['add_show_duration'], $matches) && count($matches) == 3) {
                $hours = $matches[1];
                $minutes = $matches[2];
            }           
            





    Post edited by D'man Ddan at 2014-04-22 18:21:10
  • Vote Up0Vote Down NaomiNaomi
    Posts: 228Member
    Hey sorry guys, will be working on a fix for this today.
  • Vote Up0Vote Down NaomiNaomi
    Posts: 228Member
    It looks like this is fixed already for the 2.5.2 release (not sure when that is happening), line 169 is the change needed (the definition of hours/minutes)