javascript - ExpressionEngine 2.8.1: in channel form date field gives error -


i have grid in channel form uses datefield. gives following javascript error in console: uncaught typeerror: cannot read property ‘date_format’ of undefined or in firefox: ee.date undefined

now datepicker field disabled, , no javascript after gets executed.

ee version: 2.8.1

greets rick

it sounds affected this bug contains following solution:

open system/expressionengine/fieldtypes/date/ft.date.php , @ lines 168-172:

$date_js_globals = array(     'date_format'       => ee()->localize->datepicker_format(),     'time_format'       => ee()->session->userdata('time_format', ee()->config->item('time_format')),     'include_seconds'   => ee()->session->userdata('include_seconds', ee()->config->item('include_seconds')) ); 

replace lines these:

$date_js_globals = array(     'date_format'       => ee()->localize->datepicker_format(),     'time_format'       => ee()->session->userdata('time_format', ee()->config->item('time_format')),     'include_seconds'   => ee()->session->userdata('include_seconds', ee()->config->item('include_seconds')) );  if (req == 'cp') {     ee()->javascript->set_global('date', $date_js_globals); } elseif ( ! ee()->session->cache(__class__, 'date_js_loaded')) {     // want set date global once     ee()->session->set_cache(__class__, 'date_js_loaded', true);     ee()->javascript->output('ee.date = '.json_encode($date_js_globals).';'); }  ee()->cp->add_js_script(array(     'ui' => 'datepicker',     'file' => 'cp/date' )); 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -