Division by zero

Home Forums Calendar Products Events Calendar PRO Division by zero

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1356017
    Cynthia Lockley
    Participant

    I am getting multiple messages in my error log that say:
    “PHP Warning: Division by zero in /…./public_html/events/wp-includes/comment-template.php on line 1381”. I have deactivated all my plugins to test them. The problem is that when I deactivate The Events Calendar plugin, it disables the site and all I get is a blank page so I have to reactivate that to work with the others. With all others deactivated, and reactivated one by one, it seems that the only one generating this PHP Warning is The Events Calendar plugin.
    The error I get when it is deactivated is:
    [28-Sep-2017 11:54:01 UTC] PHP Fatal error: Class ‘Tribe__Events__Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/aaron-child/functions.php on line 307
    [28-Sep-2017 11:54:08 UTC] PHP Fatal error: Class ‘Tribe__Events__Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/aaron-child/functions.php on line 292

    I created a small file to show which lines are being referred to and tried to upload it below bug I’m told “You can’t upload files of this type.” I tried it as .php and as .txt What type of files can be uploaded?

    I’ll try backward ticks to see if the code can be included in this post (the following lines are Lines 282-382 in functions.php). What needs to be changed in these lines to let the site work if the plugin is deactivated? Is any of this affecting the warning about division by zero?

    <?php
    //
    // *************************************
    // Events Calendar fix
    // Ensures proper css and javascript have been enqueued in the theme header
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //
    add_action('wp_enqueue_scripts', 'enqueue_month_view_scripts');
    function enqueue_month_view_scripts() {
    if ( is_front_page() ) {
    Tribe__Events__Template_Factory::asset_package('ajax-calendar');
    Tribe__Events__Template_Factory::asset_package('events-css');
    }
    }
    ?>
    <?php
    //
    // *************************************
    // Events Calendar fix
    // Ensures proper css and javascript have been enqueued in the theme header
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //
    add_action('wp_enqueue_scripts', 'enqueue_week_view_scripts');
    function enqueue_week_view_scripts() {
    if ( !is_front_page() ) {
    Tribe__Events__Template_Factory::asset_package('ajax-calendar');
    Tribe__Events__Template_Factory::asset_package('events-css');
    }
    }
    
    add_action('wp_enqueue_scripts', 'enqueue_list_view_scripts');
    function enqueue_list_view_scripts() {
    if ( !is_front_page() ) {
    Tribe__Events__Template_Factory::asset_package('ajax-calendar');
    Tribe__Events__Template_Factory::asset_package('events-css');
    }
    }
    
    add_action('wp_enqueue_scripts', 'enqueue_photo_view_scripts');
    function enqueue_photo_view_scripts() {
    if ( !is_front_page() ) {
    Tribe__Events__Template_Factory::asset_package('ajax-calendar');
    Tribe__Events__Template_Factory::asset_package('events-css');
    }
    }
    
    add_action('wp_enqueue_scripts', 'enqueue_map_view_scripts');
    function enqueue_map_view_scripts() {
    if ( !is_front_page() ) {
    Tribe__Events__Template_Factory::asset_package('ajax-calendar');
    Tribe__Events__Template_Factory::asset_package('events-css');
    }
    }
    ?>
    

    Thanks for your help.

    #1356962
    Patricia
    Member

    Hey Cynthia,

    Thank you for reaching out to us!

    This PHP Fatal error is happening while having The Events Calendar disabled because the custom code in your theme’s functions.php file is calling a class ‘Tribe__Events__Template_Factory’ that no longer exists (because the plugin was disabled).

    It doesn’t seem to be associated with the first PHP Warning you shared.

    To avoid the Fatal Error during your debug process, I would suggest you to simply comment the actions that are calling ‘Tribe__Events__Template_Factory’ in functions.php file and you should be good to go.

    I hope this helps! Let me know if you have any other questions in the mean time and I’ll be happy to assist.

    Best Regards,

    Patricia

    #1357481
    Cynthia Lockley
    Participant

    Hello,
    I commented out all the actions that modified The Events Calendar plugin in the functions.php file so I no longer get the PHP Fatal Error when I deactivate The Events Calendar plugin.
    I then deactivated all other plugins and started testing by turning them back on one-by-one. Nothing generated the “Divide by Zero” error messages up to The Events Calendar plugins. I left them all to the end. I reactivated first the basic The Events Calendar plugin and no error messages. I reactivated The Events Calendar Pro plugin and got no error messages.

    I got the error messages after I reactivated The Events Calendar: Eventbrite Tickets plugin:

    
    [01-Oct-2017 09:11:36 UTC] PHP Warning:  Division by zero in /home/stcwdc/public_html/events/wp-includes/comment-template.php on line 1381
    [01-Oct-2017 09:11:36 UTC] PHP Warning:  Division by zero in /home/stcwdc/public_html/events/wp-includes/comment-template.php on line 1381
    [01-Oct-2017 09:11:38 UTC] PHP Warning:  Division by zero in /home/stcwdc/public_html/events/wp-includes/comment-template.php on line 1381
    [01-Oct-2017 09:11:38 UTC] PHP Warning:  Division by zero in /home/stcwdc/public_html/events/wp-includes/comment-template.php on line 1381
    

    The PHP error messages are being generated by something in The Events Calendar: Eventbrite Tickets plugin that is conflicting with the wp-includes/comment-template.php on line 1381. Now at least I know which plugin is causing the errors. Perhaps you can find the problem and fix it?

    Thanks.

    #1357846
    Patricia
    Member

    Hi Cynthia,

    I’ve ran some tests from my end and couldn’t reproduce the issue you are experiencing from here with all Modern Tribe plugins enabled (including the-events-calendar-eventbrite-tickets version 4.4.8) and using the default Twenty Seventeen theme.

    I would recommend you to make sure that all of your plugins are up to date and review your theme, looking for a customization that might be causing this PHP Warning. I would also recommend you to temporarily change your current active theme to another one: this way you can check if there’s a conflict between eventbrite-tickets and your theme.

    Let me know your test results and I’ll be happy to further investigate if necessary!

    Best Regards,

    Patricia

    #1368155
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Division by zero’ is closed to new replies.