I'm using Rob's great Resource router and Solspace Calendar, everything works fine until I try to do a validation in Resource router, then Calendar gives a huge error when trying to user {exp:calendar:events} tag:

Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Closure'
 is not allowed' in /Applications/XAMPP/xamppfiles/htdocs/domain/third_party/calendar/addon_builder/
addon_builder.php:3073 Stack trace: #0 
/Applications/XAMPP/xamppfiles/htdocs/domain/third_party/calendar/addon_builder/addon_builder.php(3073): serialize(Array) #1 [internal function]: Addon_builder_calendar->_imploder(Array) #2 
/Applications/XAMPP/xamppfiles/htdocs/domain/third_party/calendar/addon_builder/data.addon_builder.php(180): call_user_func_array(Array, Array) #3 [internal function]: Addon_builder_data_calendar->__call('_imploder', Array) #4 /Applications/XAMPP/xamppfiles/htdocs/domain/third_party/calendar/data.calendar.php(2843): Calendar_data->_imploder(Array) #5 /Applications/XAMPP/xamppfiles/htdocs/domain/third_party/calendar/mod.calendar.php(736): Calendar_data->fetch_event_ids(Object(Calendar_parameters)) #6 /Applications/XAMPP/xamppfiles/htdocs/domain/ee-admin/expressionengine/libraries/Template.php(1308): in /Applications/XAMPP/xamppfiles/htdocs/domain/third_party/calendar/addon_builder/addon_builder.php on line 3073

This happens when I use this rule in Router:

':category_url_title' => function($router, $wildcard) {
        if ($wildcard->isValidCategoryUrlTitle()) {
        } else {

but without callbacks it works just fine:

':category_url_title' => 'router/home',

I could find some other way to validate it, but Router has so many usefull callbacks that its a shame not to use them. I also opened ticket on Rob's Router github just to cross reference https://github.com/rsanchez/resource_router/issues/3

EE 2.7.3. Calendar 1.8.5


  • For Solspace: Resource Router has anonymous functions in the main EE config file, which I believe is causing this issue. It seems like Calendar may be serializing the $config? Mar 7, 2014 at 14:56
  • This is fixed in new version of Resource router :) Thanks Rob!
    – Davor Peic
    Mar 15, 2014 at 10:42


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.