• Resolved Kevin Pfeifer

    (@beardcat)


    After updating to 6.15.12 I get the following error while trying to display the month calendar page:

    ArgumentCountError: 4 arguments are required, 3 given
    #0 /wp-content/plugins/the-events-calendar/src/views/v2/month/calendar-body/day/date.php(69): sprintf
    #1 /wp-content/plugins/the-events-calendar/src/views/v2/month/calendar-body/day/date.php(69): include
    #2 /wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(1069): Tribe__Template::template_safe_include
    #3 /wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(919): Tribe__Template::template
    #4 /wp-content/plugins/the-events-calendar/src/views/v2/month/calendar-body/day.php(55): include
    #5 /wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(1069): Tribe__Template::template_safe_include
    #6 /wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(919): Tribe__Template::template
    #7 /wp-content/plugins/the-events-calendar/src/views/v2/month/calendar-body.php(25): include
    #8 /wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(1069): Tribe__Template::template_safe_include
    #9 /wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(919): Tribe__Template::template
    #10 /wp-content/plugins/the-events-calendar/src/views/v2/month.php(69): include
    #11 /wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(1069): Tribe__Template::template_safe_include
    #12 /wp-content/plugins/the-events-calendar/common/src/Tribe/Template.php(919): Tribe__Template::template
    #13 /wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/Template.php(71): Tribe\Events\Views\V2\Template::render
    #14 /wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/View.php(743): Tribe\Events\Views\V2\View::get_html
    #15 /wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/Template_Bootstrap.php(313): Tribe\Events\Views\V2\Template_Bootstrap::get_view_html
    #16 /wp-content/plugins/the-events-calendar/src/views/v2/default-template.php(19): include
    #17 /wp-includes/template-loader.php(106): require_once
    #18 /wp-blog-header.php(19): require
    #19 /index.php(17)

    so something is wrong with this code

    $num_events_label = sprintf(
    // Translators: %1$s = number of events, %2$s = event label (singular or plural).
    _n( '%1$s %2$s', '%1$s %2$s', $day['found_events'], 'the-events-calendar' ),
    number_format_i18n( $day['found_events'] ),
    1 === (int) $day['found_events']
    ? tribe_get_event_label_singular_lowercase()
    : tribe_get_event_label_plural_lowercase()
    );

    or its automatically downloaded german translation.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support tristan083

    (@tristan083)

    Hi @beardcat ,

    Thank you for reaching out.

    Unfortunately, I have not been able to reproduce the issue in my testing environment running only the latest versions of The Events Calendar plugins and the twenty-twenty-one theme.

    Do you happen to have any view templates customized (template customization) in your theme folder?

    Also, for us to understand and learn more about your setup, could you provide the version of the following?

    1. PHP
    2. WordPress
    3. The Events Calendar
    4. Events Calendar Pro (if using)
    5. Theme and Version
    Thread Starter Kevin Pfeifer

    (@beardcat)

    We use a custom-built theme but do not have any overwritten templates.

    PHP: 8.2.24
    WordPress: 6.8.3
    The Events Calendar: 6.15.12
    No Events Calendar Pro version

    Plugin Author Dimitris Pantazis

    (@dpantazis)

    Hey @beardcat,

    Would you be so kind as trying the below snippet in a staging environment ? I believe we have identified the issue and it is related to translations. While we are taking action to fix it, we are hoping the snippet below would fix the issue for the ones using it.

    You can place this snippet in a functions.php or using a plugin which enables you to write a php snippet.

    add_filter( 'ngettext_the-events-calendar', function ( $translation, $single, $plural ) {
    if ( '%1$s %3$s' !== $translation ) {
    return $translation;
    }

    if ( '%1$s %2$s' !== $plural || '%1$s %2$s' !== $single ) {
    return $translation;
    }

    return '%1$s %2$s';
    }, 10, 3 );

    Thank you,

    Dimi

    Thread Starter Kevin Pfeifer

    (@beardcat)

    That indeed fixes the problem. Weird, that a translation can break the website 😂

    Plugin Author Dimitris Pantazis

    (@dpantazis)

    @beardcat thank you for trying it ! We really appreciate it. Yea, it is weird haha. We are getting to the bottom of it.

    For English (Canada), lines 943 and 945, in the-events-calendar-en_CA.po, should be msgid_plural "%1$s %2$" and msgstr[1] "%1$s %2$s" .
    That fixes the issue after recompiling the .mo file.

    Plugin Support Darian

    (@d0153)

    Hi @beardcat @hartl

    We’ve just released a fix for this issue. To resolve it, please update your plugins to the latest version.

    As always, we recommend testing updates on a staging site first, but it should all be smooth sailing. If you have any questions or run into any issues, please let us know—we’re here to help!

    Plugin Support Darian

    (@d0153)

    Hi there,

    It appears that there hasn’t been any recent activity on this thread, so we’ll consider it resolved. However, if you have any additional questions or concerns, feel free to start a new thread.

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

You must be logged in to reply to this topic.