• Resolved joneiseman

    (@joneiseman)


    I’m getting the following in my php error log:
    PHP Deprecated: Function Tribe__Events__Template__Month::calculate_final_cell_date is deprecated since version 6.0.0 with no alternative available.

    I see Tribe__Events__Template__Month::calculate_final_cell_date is called from
    Events_Calendar_Schema::get_month_events (in the namespace Yoast\WP\SEO\Generators\Schema\Third_Party in the file wordpress-seo/src/generators/schema/third-party/events-calendar-schema.php).

Viewing 10 replies - 1 through 10 (of 10 total)
  • Same here. Began with the Events Calendar update from v6.0.1.1 to v6.0.2.

    Ah, and disabling either the Events Calendar plugin or the Yoast SEO plugin stops the problem. It appears to be a conflict between those two plugins.

    Hey @fssbob & @joneiseman,

    Thank you for using Yoast SEO and for reaching out!

    I tried replicating the deprecated warning but to no avail. I added The Events Calendar v6.0.2 together with Yoast SEO 19.9 on a local site. Created an event and entered some date-related fields – but on the front end or in the log files, I can’t see any similar warning with “calculate_final_cell_date”. I did see a lot of DateTime warnings when The Events Calendar is activated on PHP 8.1 but unrelated to our Yoast integration or this specific warning.

    Could you give us any steps to reproduce the warning you get? (calculate_final_cell_date)

    Thread Starter joneiseman

    (@joneiseman)

    I’m not sure how to reproduce the deprecated messages. However, here’s the stack trace in case that helps:

    [25-Oct-2022 10:41:02 UTC] Array
    (
        [0] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/the-events-calendar/src/deprecated/Tribe__Events__Template__Month.php
                [line] => 76
                [function] => _deprecated_function
            )
    
        [1] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/generators/schema/third-party/events-calendar-schema.php
                [line] => 232
                [function] => calculate_final_cell_date
                [class] => Tribe__Events__Template__Month
                [type] => ::
            )
    
        [2] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/generators/schema/third-party/events-calendar-schema.php
                [line] => 65
                [function] => get_month_events
                [class] => Yoast\WP\SEO\Generators\Schema\Third_Party\Events_Calendar_Schema
                [type] => ->
            )
    
        [3] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/generators/schema-generator.php
                [line] => 129
                [function] => generate
                [class] => Yoast\WP\SEO\Generators\Schema\Third_Party\Events_Calendar_Schema
                [type] => ->
            )
    
        [4] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/generators/schema-generator.php
                [line] => 76
                [function] => generate_graph
                [class] => Yoast\WP\SEO\Generators\Schema_Generator
                [type] => ->
            )
    
        [5] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/presentations/indexable-presentation.php
                [line] => 749
                [function] => generate
                [class] => Yoast\WP\SEO\Generators\Schema_Generator
                [type] => ->
            )
    
        [6] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/presentations/abstract-presentation.php
                [line] => 64
                [function] => generate_schema
                [class] => Yoast\WP\SEO\Presentations\Indexable_Presentation
                [type] => ->
            )
    
        [7] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/presenters/schema-presenter.php
                [line] => 60
                [function] => __get
                [class] => Yoast\WP\SEO\Presentations\Abstract_Presentation
                [type] => ->
            )
    
        [8] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/presenters/schema-presenter.php
                [line] => 44
                [function] => get
                [class] => Yoast\WP\SEO\Presenters\Schema_Presenter
                [type] => ->
            )
    
        [9] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php
                [line] => 326
                [function] => present
                [class] => Yoast\WP\SEO\Presenters\Schema_Presenter
                [type] => ->
            )
    
        [10] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/class-wp-hook.php
                [line] => 307
                [function] => present_head
                [class] => Yoast\WP\SEO\Integrations\Front_End_Integration
                [type] => ->
            )
    
        [11] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/class-wp-hook.php
                [line] => 331
                [function] => apply_filters
                [class] => WP_Hook
                [type] => ->
            )
    
        [12] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/plugin.php
                [line] => 476
                [function] => do_action
                [class] => WP_Hook
                [type] => ->
            )
    
        [13] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/wordpress-seo/src/integrations/front-end-integration.php
                [line] => 300
                [function] => do_action
            )
    
        [14] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/class-wp-hook.php
                [line] => 307
                [function] => call_wpseo_head
                [class] => Yoast\WP\SEO\Integrations\Front_End_Integration
                [type] => ->
            )
    
        [15] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/class-wp-hook.php
                [line] => 331
                [function] => apply_filters
                [class] => WP_Hook
                [type] => ->
            )
    
        [16] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/plugin.php
                [line] => 476
                [function] => do_action
                [class] => WP_Hook
                [type] => ->
            )
    
        [17] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/general-template.php
                [line] => 3042
                [function] => do_action
            )
    
        [18] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/themes/generatepress_child/header.php
                [line] => 27
                [function] => wp_head
            )
    
        [19] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/template.php
                [line] => 770
                [args] => Array
                    (
                        [0] => /home/mafwor5/public_html/wp-content/themes/generatepress_child/header.php
                    )
    
                [function] => require_once
            )
    
        [20] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/template.php
                [line] => 716
                [function] => load_template
            )
    
        [21] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/general-template.php
                [line] => 48
                [function] => locate_template
            )
    
        [22] => Array
            (
                [file] => /home/mafwor5/public_html/wp-content/plugins/the-events-calendar/src/views/v2/default-template.php
                [line] => 17
                [function] => get_header
            )
    
        [23] => Array
            (
                [file] => /home/mafwor5/public_html/wp-includes/template-loader.php
                [line] => 106
                [args] => Array
                    (
                        [0] => /home/mafwor5/public_html/wp-content/plugins/the-events-calendar/src/views/v2/default-template.php
                    )
    
                [function] => include
            )
    
        [24] => Array
            (
                [file] => /home/mafwor5/public_html/wp-blog-header.php
                [line] => 19
                [args] => Array
                    (
                        [0] => /home/mafwor5/public_html/wp-includes/template-loader.php
                    )
    
                [function] => require_once
            )
    
        [25] => Array
            (
                [file] => /home/mafwor5/public_html/index.php
                [line] => 17
                [args] => Array
                    (
                        [0] => /home/mafwor5/public_html/wp-blog-header.php
                    )
    
                [function] => require
            )
    
    )

    And if you want to take a look at a site showing where it appears with WP_DEBUG_DISPLAY turned on, take a look at https://test.lapena.org/. Notice also how long it takes the site to refresh. The refresh time is correlated with whatever is causing this error.

    Plugin Support Maybellyne

    (@maybellyne)

    Hello @joneiseman and @fssbob

    I’m sorry that you’re experiencing issues with our plugin. We are investigating an issue where there are deprecation notices when you’re running Yoast SEO 19.9 with The Events Calendar 6.0.2. Once there’s an update, I’ll inform you.

    I was having what seems to be the same issue. I did a little digging around in the plugin and found this in the yoast plugin at /wordpress-seo/src/generators/schema/third-party/events-calendar-schema.php.
    **
    * Adds our Event piece of the graph.
    * Partially lifted from the ‘Tribe__JSON_LD__Abstract’ class.
    *
    * @see https://docs.theeventscalendar.com/reference/classes/tribe__json_ld__abstract/
    * @return array Event Schema markup
    */
    public function generate() {
    $posts = [];

    if ( \is_singular( ‘tribe_events’ ) ) {
    global $post;
    $posts[] = $post;
    }
    elseif ( \tribe_is_month() ) {
    $posts = $this->get_month_events();
    }

    When you comment out the depreciated tribe_is_month “elseif” statement the site works perfectly for me. I would assume this might work for you as well but i would hope that the Yoast team makes an update for this soon as i dont normally recomend making edits to active plugins for obvious reasons.

    • This reply was modified 2 years, 4 months ago by kidkaos77.

    Just wanted to also clarify that the Tribe__Events__Template__Month call that @joneiseman mentioned is on the file that i mentioned earlier (/wordpress-seo/src/generators/schema/third-party/events-calendar-schema.php) in a function at the bottom of the page. By commenting out the tribe_is_month endif statements on the file you will stop the plugin from calling the deprecated Tribe__Events__Template__Month class, which should give you a temporary fix until the plugin is updated.

    • This reply was modified 2 years, 4 months ago by kidkaos77.

    I tried the temporary solution suggested by kidkaos77, however it didn’t work for me.
    So I have gone back to temporarily deactivating Yoast, and the Event Calander appears without the deprecated warnings. Hope this gets fixed soon.

    Rosi

    Same issue here. Have disabled Yoast and will watch for update(s).

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘PHP Deprecated: calculate_final_cell_date’ is closed to new replies.