• Resolved andreigh7

    (@andreigh7)


    Hello,

    I had a bunch of cache issues (events showing up in listings in different languages, regardless of the current language set with TranslatePress), until I’ve done the following changes:

    common/src/Tribe/Models/Post_Types/Base.php:
    in get_properties_cache_key:

    public function get_properties_cache_key( string $filter ): string {
           $lang = get_bloginfo("language");
           return $this->get_cache_slug() . '_' . $this->post->ID . '_' . $filter . '_' . $lang;
    } 

    and in src/functions/template-tags/event.php:

    // Build a memoization cache key salted by the request parameters.
        $key_fields = [
            $cache_post->ID,
            $cache_post->post_modified,
            // Use the post_password field as we show/hide some information depending on that.
            $cache_post->post_password,
            // We must include options on cache key, because options influence the hydrated data on the Event object.
            Tribe__Settings_Manager::get_options(),
            $cache['option_start_of_week'],
            $cache['option_timezone_string'],
            $cache['option_gmt_offset'],
            $output,
            $filter,
            get_bloginfo("language"),
        ];

    Any chance you can get these changes in the next release please ?

    Thank you !

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Darian

    (@d0153)

    Hi @andreigh7

    Thanks for reaching out and for sharing all the information regarding the caching issue.

    I understand the importance of your suggestion, and I will definitely share it with the team for their review and possible inclusion in the upcoming release. Thank you for bringing this to our attention.

    Let us know if you have other questions or concerns.

    Plugin Support Darian

    (@d0153)

    Hi there,

    It seems like this thread has been quiet for a bit, so we’ll go ahead and mark it as resolved. However, if any further questions or concerns come up, please don’t hesitate to start a new thread.

    Thread Starter andreigh7

    (@andreigh7)

    Hello, this is still not resolved in the current version. I’ve updated The Events Calendar plugin and had to re-do my changes in the plugin source code.

    Can you please increase the priority ? I bet there are *a lot* of users of both TranslatePress and The Events Calendar.

    Also the fix is really simple and non-intrusive, I don’t see any reason why you wouldn’t get this in the official plugin source code.

    Thank you !

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Cache issues with translation/translatepress’ is closed to new replies.