craigh / PostCalendar

PostCalendar is a calendar module for the Zikula Application Framework
20 stars 9 forks source link

cant add any new event since update to zk1.4.4build156 #113

Closed MrMontesa closed 7 years ago

MrMontesa commented 7 years ago

Since updating to 1.4.4build156 I cant add any new events any longer. The stack trace is:

Warning: array_combine(): Both parameters should have an equal number of elements
500 Internal Server Error - ContextErrorException

 Symfony\Component\Debug\Exception\ContextErrorException: Warning: array_combine(): Both parameters should have an equal number of elements
    at n/a
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/modules/PostCalendar/lib/PostCalendar/Api/Event.php line 314

    at Symfony\Component\Debug\ErrorHandler->handleError('2', 'array_combine(): Both parameters should have an equal number of elements', '/data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/modules/PostCalendar/lib/PostCalendar/Api/Event.php', '314', array('args' => array('eventdata' => array('is_update' => false, 'data_loaded' => true, 'preview' => ''), 'date' => object(DateTime), 'func' => 'create'), 'eventdata' => array('is_update' => false, 'data_loaded' => true, 'preview' => '', 'endDate' => object(DateTime), 'eventStart' => object(DateTime), 'eventEnd' => object(DateTime), 'aid' => '2', 'categories' => array('Main' => '10001'), 'alldayevent' => '0', 'HTMLorTextVal' => 'text', 'sharing' => '3', 'repeats' => false), 'form_data' => array('username_selected' => 's.waitz', 'catregistry' => array('Main' => '10000'), 'cat_count' => '1', 'sharingselect' => array('Allgemein'), 'SelectedRepeat' => '', 'SelectedRepeatOn' => '', 'repeat_freq_type' => array('Tag(e)', 'Woche(n)', 'Monat(e)', 'Jahr(e)'), 'repeat_on_num' => array('ersten', 'zweiten', 'dritten', 'vierten', 'letzten')), 'eventDefaults' => array('sharing' => '3', 'alldayevent' => '0', 'fee' => '', 'categories' => array('Main' => '10001'), 'location' => array('event_location' => '', 'event_street1' => '', 'event_street2' => '', 'event_city' => '', 'event_state' => '', 'event_postal' => ''), 'contname' => '', 'conttel' => '', 'contemail' => '', 'website' => '', 'duration' => '10800', 'startTime' => '13:00'), 'startTimeParts' => array('13', '00'), 'in' => array('Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag'), 'keys' => array('0', '1', '2', '3', '4', '5', '6'), 'selectarray' => array('ersten', 'zweiten', 'dritten', 'vierten', 'letzten')))
        in  line 

    at array_combine(array('0', '1', '2', '3', '4', '5', '6'), array('Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag'))
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/modules/PostCalendar/lib/PostCalendar/Api/Event.php line 314

    at PostCalendar_Api_Event->buildSubmitForm(array('eventdata' => array('is_update' => false, 'data_loaded' => true, 'preview' => ''), 'date' => object(DateTime), 'func' => 'create'))
        in  line 

    at call_user_func(array(object(PostCalendar_Api_Event), 'buildSubmitForm'), array('eventdata' => array('is_update' => false, 'data_loaded' => true, 'preview' => ''), 'date' => object(DateTime), 'func' => 'create'))
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/lib/util/ModUtil.php line 1217

    at ModUtil::exec('PostCalendar', 'event', 'buildSubmitForm', array('eventdata' => array('is_update' => false, 'data_loaded' => true, 'preview' => ''), 'date' => object(DateTime), 'func' => 'create'), true, null)
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/lib/util/ModUtil.php line 1293

    at ModUtil::apiFunc('PostCalendar', 'event', 'buildSubmitForm', array('eventdata' => array('is_update' => false, 'data_loaded' => true, 'preview' => ''), 'date' => object(DateTime), 'func' => 'create'))
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/modules/PostCalendar/lib/PostCalendar/Controller/Event.php line 235

    at PostCalendar_Controller_Event->create(array('date' => '20161209'))
        in  line 

    at call_user_func_array(array(object(PostCalendar_Controller_Event), 'create'), array(array('date' => '20161209')))
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/lib/legacy/Zikula/AbstractController.php line 153

    at Zikula_AbstractController->__call('createAction', array(array('date' => '20161209')))
        in  line 

    at PostCalendar_Controller_Event->createAction(array('date' => '20161209'))
        in  line 

    at call_user_func(array(object(PostCalendar_Controller_Event), 'createAction'), array('date' => '20161209'))
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/lib/util/ModUtil.php line 1217

    at ModUtil::exec('PostCalendar', 'event', 'create', array('date' => '20161209'), false, null)
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/lib/util/ModUtil.php line 1267

    at ModUtil::func('PostCalendar', 'event', 'create', array('date' => '20161209'))
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/lib/Zikula/Bundle/CoreBundle/Controller/LegacyController.php line 176

    at Zikula\Bundle\CoreBundle\Controller\LegacyController->getLegacyResponse('PostCalendar', 'event', 'create', array('date' => '20161209'), false)
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/lib/Zikula/Bundle/CoreBundle/Controller/LegacyController.php line 90

    at Zikula\Bundle\CoreBundle\Controller\LegacyController->legacyAction(object(Zikula_Request_Http))
        in  line 

    at call_user_func_array(array(object(LegacyController), 'legacyAction'), array(object(Zikula_Request_Http)))
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 144

    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Zikula_Request_Http), '1')
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php line 64

    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Zikula_Request_Http), '1', true)
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DependencyInjection/ContainerAwareHttpKernel.php line 69

    at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Zikula_Request_Http), '1', true)
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php line 185

    at Symfony\Component\HttpKernel\Kernel->handle(object(Zikula_Request_Http))
        in /data/web/1/000/027/915/75642/htdocs/staging.amc-idstein/index.php line 23
craigh commented 7 years ago

looks like a translation problem. Check your translations.

array_combine(array('0', '1', '2', '3', '4', '5', '6'), array('Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag'))

craigh commented 7 years ago

I'll bet that your translation for

#: lib/PostCalendar/Api/Event.php:305 lib/PostCalendar/Api/Event.php:385
msgid "Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday"
msgstr ""

is Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag and should be Sonntag/Montag/Dienstag/Mittwoch/Donnerstag/Freitag/Samstag

MrMontesa commented 7 years ago

I dont have a german translation for Postcalendar installed right now. Only the german core. There I have:

[user@w31 ~/htdocs/staging.amc-idstein/app/Resources/locale/de/LC_MESSAGES]$ grep Sunday *
Binary file zikula.mo matches
zikula.po:msgid "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"

I just recognized that this only happns when debug mode is on by custom_parameters config. After disabling debug the page loads again, but cant add any events since the input fields are read-only.

Lets postpone this analysis as my testbed is too unstable right now due to other tests ongoing. I will get back on this later.

MrMontesa commented 7 years ago

Ok, I can confirm that your first guess was right. After updating the translation no error messages any longer. Just one confirmation. This error only showed up when debug : true was set in custom_parameters. Also from users perspective its bad that a translation can have such severe effects. Wondering if theres a possiblity to prevent Zikula from bailing out when Translation is wrong. But this is another story.

Thanks for your help. Closing this issue