Fatal error: Class 'Tribe_Template_Factory' not found

Home Forums Calendar Products Events Calendar PRO Fatal error: Class 'Tribe_Template_Factory' not found

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

    This may be related to the ticket at https://theeventscalendar.com/support/forums/topic/after-latest-update-site-says-nothing-found-error-log-is-full-of-calendar-probs/ that I hadn’t noticed when I wrote that ticket. I was looking at my files and looked at the error_log to see if I was getting anymore errors since I reinstalled the earlier version of The Events Calendar to solve the problems caused by the update (https://theeventscalendar.com/support/forums/topic/after-latest-update-site-says-nothing-found-error-log-is-full-of-calendar-probs/).

    There were no new since retreating to the previous versions but I found the following added to the end of the log that I copied in the other ticket:
    [11-Sep-2015 15:41:23 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 15:41:33 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 15:43:42 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 16:21:28 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 16:21:30 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 17:25:08 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 17:25:10 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 17:45:38 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 18:04:30 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 18:11:35 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 18:23:25 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 18:23:28 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 18:24:29 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 18:24:30 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 19:27:24 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 19:27:26 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 19:27:28 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 20:07:37 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 20:15:59 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 20:23:44 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 20:31:06 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 20:31:07 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 20:35:20 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 20:41:50 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 20:41:59 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 20:48:46 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95
    [11-Sep-2015 21:01:34 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 21:11:38 UTC] PHP Fatal error: Call to undefined function tribe_get_start_date() in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 195
    [11-Sep-2015 21:21:05 UTC] PHP Fatal error: Class ‘Tribe_Template_Factory’ not found in /home/stcwdc/public_html/events/wp-content/themes/twentyeleven-child/functions.php on line 95

    I am not getting this fatal error anymore since I dropped back to the previous version so it seems something in the new version was tripping up on this. I looked at my functions file in my child theme and it has the following fix that was added by support in response to an earlier problem I had. I don’t know if this fix should be deleted when the new release comes out or if it needs modifying because it seems the new version is looking for something on line 95

    85 <?php
    86 //
    87 // *************************************
    88 // Events Calendar fix
    89 // Ensures proper css and javascript have been enqueued in the theme header
    90 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    91 //
    92 add_action(‘wp_enqueue_scripts’, ‘enqueue_month_view_scripts’);
    93 function enqueue_month_view_scripts() {
    94 if ( is_front_page() ) {
    95 Tribe_Template_Factory::asset_package(‘ajax-calendar’);
    96Tribe_Template_Factory::asset_package(‘events-css’);
    97 }
    98 }
    99 ?>

    #1006255
    Cynthia Lockley
    Participant

    More info. I just noticed that the errors are also pointing to line 195 in my functions file–looks like it definitely goes with the earlier problem I reported with the start date.

    166 <?php
    167 //
    168 // *************************************
    169 // Events Calendar fix
    170 // Add Events to RSS Feed
    171 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    172 //
    173 function add_events_to_rss_feed( $args ) {
    174 if ( isset( $args[‘feed’] ) && !isset( $args[‘post_type’] ) )
    175 $args[‘post_type’] = array(‘post’, ‘tribe_events’);
    176 return $args;
    177 }
    178
    179 add_filter( ‘request’, ‘add_events_to_rss_feed’ );
    180
    181 // Add Tribe Event Namespace
    182 add_filter( ‘rss2_ns’, ‘events_rss2_namespace’ );
    183 function events_rss2_namespace() {
    184 echo ‘xmlns:ev=”http://purl.org/rss/2.0/modules/event/”&#8216;;
    185 }
    186 ?>
    187 <?php
    188 // Add Event Date to RSS Feeds
    189 add_action(‘rss_item’,’tribe_rss_feed_add_eventdate’);
    190 add_action(‘rss2_item’,’tribe_rss_feed_add_eventdate’);
    191 add_action(‘commentsrss2_item’,’tribe_rss_feed_add_eventdate’);
    192 function tribe_rss_feed_add_eventdate() { ?>
    193
    194 <ev:tribe_event_meta xmlns:ev=”Event”>
    195 <?php if (tribe_get_start_date() !== tribe_get_end_date() ) { ?>
    196
    197 <ev:startdate><?php echo tribe_get_start_date(); ?></ev:startdate>
    198 <ev:enddate><?php echo tribe_get_end_date(); ?></ev:enddate>
    199
    200 <?php } else { ?>
    201
    202 <ev:startdate><?php echo tribe_get_start_date(); ?></ev:startdate>
    203
    204 <?php } ?>
    205 </ev:tribe_event_meta>
    206
    207 <?php }
    208 ?>

    Maybe others who are also having the problem with the new version are using this same fix provided by Support a few versions back.

    #1006453
    Brian
    Keymaster

    Hi,

    Sorry for the issues you are having. I can help out here.

    For this the template factory has changed in 3.10 so try this instead:

    Tribe__Events__Template_Factory::asset_package

    This function still exists as is:

    tribe_get_start_date()

    So it is not clear why it is having issues.

    I just tried out the coding we have on our site and did not get an error.

    See if replacing that coding with the current tutorial helps:

    https://theeventscalendar.com/knowledgebase/customize-rss-feed/

    Let me know how that works out.

    Thanks

    #1006729
    Cynthia Lockley
    Participant

    Brian,

    Thanks. I updated the functions.php file in my development site, then upgraded to 3.12.1 to see if that fixed the original problem. It didn’t. The home page still gives me a search result saying Nothing Found instead of the calendar and the posts. The error log still gives
    [18-Sep-2015 20:15:15 UTC] WordPress database error Duplicate column name ‘post_date’ for query
    SELECT
    SQL_CALC_FOUND_ROWS *
    FROM (
    SELECT DISTINCT 52sggfg_posts.*, IF (52sggfg_posts.post_type = ‘tribe_events’, 52sggfg_postmeta.meta_value, 52sggfg_posts.post_date) AS post_date FROM 52sggfg_posts LEFT JOIN 52sggfg_postmeta as 52sggfg_postmeta on 52sggfg_posts.ID = 52sggfg_postmeta.post_id AND 52sggfg_postmeta.meta_key = ‘_EventStartDate’ WHERE 1=1 AND 52sggfg_posts.post_type IN (‘post’, ‘tribe_events’) AND (52sggfg_posts.post_status = ‘publish’ OR 52sggfg_posts.post_author = 1 AND 52sggfg_posts.post_status = ‘private’) ORDER BY post_date DESC
    ) a
    GROUP BY IF( post_parent = 0, ID, post_parent )
    ORDER BY EventStartDate ASC
    LIMIT 0, 6
    made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
    [18-Sep-2015 20:47:42 UTC] WordPress database error Duplicate column name ‘post_date’ for query
    SELECT
    SQL_CALC_FOUND_ROWS *
    FROM (
    SELECT DISTINCT 52sggfg_posts.*, IF (52sggfg_posts.post_type = ‘tribe_events’, 52sggfg_postmeta.meta_value, 52sggfg_posts.post_date) AS post_date FROM 52sggfg_posts LEFT JOIN 52sggfg_postmeta as 52sggfg_postmeta on 52sggfg_posts.ID = 52sggfg_postmeta.post_id AND 52sggfg_postmeta.meta_key = ‘_EventStartDate’ WHERE 1=1 AND 52sggfg_posts.post_type IN (‘post’, ‘tribe_events’) AND (52sggfg_posts.post_status = ‘publish’ OR 52sggfg_posts.post_author = 1 AND 52sggfg_posts.post_status = ‘private’) ORDER BY post_date DESC
    ) a
    GROUP BY IF( post_parent = 0, ID, post_parent )
    ORDER BY EventStartDate ASC
    LIMIT 0, 6
    made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts

    It does seem to have fixed the Fatal errors related to top of this thread–no more of those messages in the error log.

    The URL for my development site is http://competition.stcwdc.org/

    I’ll leave 3.12.1 installed there for now. I am using the earlier 3.11.1 version on my production site at http://events.stcwdc.org/

    #1006971
    Brian
    Keymaster

    For the home page try this:

    If you uncheck this setting here:

    Events > Settings > General Tab > “Recurring event instances”

    Does the home page work again?

    If so that is a bug and we are working on a patch to release hopefully this week.

    Let me know.

    Thanks

    #1007415
    Cynthia Lockley
    Participant

    Yes! The home page came back.

    By the way, the number of posts to a ticket in the forum is not updating. There have been five posts to this ticket (this one will be number six) but the number shown in the forum is still at two.

    I also checked the error log and it has this error flagged that may be affecting things?

    WordPress database error Duplicate column name ‘post_date’ for query
    SELECT
    SQL_CALC_FOUND_ROWS *
    FROM (
    SELECT DISTINCT 52sggfg_posts.*, IF (52sggfg_posts.post_type = ‘tribe_events’, 52sggfg_postmeta.meta_value, 52sggfg_posts.post_date) AS post_date FROM 52sggfg_posts LEFT JOIN 52sggfg_postmeta as 52sggfg_postmeta on 52sggfg_posts.ID = 52sggfg_postmeta.post_id AND 52sggfg_postmeta.meta_key = ‘_EventStartDate’ WHERE 1=1 AND 52sggfg_posts.post_type IN (‘post’, ‘tribe_events’) AND (52sggfg_posts.post_status = ‘publish’ OR 52sggfg_posts.post_author = 1 AND 52sggfg_posts.post_status = ‘private’) ORDER BY post_date DESC
    ) a
    GROUP BY IF( post_parent = 0, ID, post_parent )
    ORDER BY EventStartDate ASC
    LIMIT 0, 6
    made by require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts

    #1007474
    Brian
    Keymaster

    Hi,

    That error in the log is related to changing this setting:

    Events > Settings > General Tab > “Recurring event instances”

    And your home page not showing content.

    So unchecking that prevents the error until we can get a patch out.

    We have a patch almost ready to go for this and hope to release it in the next couple of days.

    Thanks for letting me know about the post count, it maybe the caching system preventing that from updating.

    Cheers

    #1007480
    Cynthia Lockley
    Participant

    Thanks. I’ll delete that error log and let a new one form if need be.

    #1007623
    Brian
    Keymaster

    Sounds good.

    We will update this ticket when we release the fix either today or tomorrow hopefully.

    For now I will close it to new replies.

    If you need anything else related to this topic or another please post a new topic on the forum and we can help you out.

    Thanks

    #1008120
    Geoff
    Member

    Hi Cynthia,

    Just want to let you know that we also just shipped an update and patch for this issue as well. Please update and feel free to drop us a new note if you continue to bump into any issues with this. We appreciate your patience while we worked on this–thanks again for the reports!

    Cheers,
    Geoff

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Fatal error: Class 'Tribe_Template_Factory' not found’ is closed to new replies.