Skip to content

Upcoming events tag not accepting event ID after upgrade to 6 #173

Description

@earthwytch

I have migrated existing code over from Statamic 5 to Statamic 6. Since then, the event:upcoming tag no longer works for me when I try to filter the results by event id. I have an event view that displays event info and lists upcoming sessions for the event. It looks like this in Antlers (with some extra debugging code):

resources/views/events/event.antlers.html

                <!-- Upcoming sessions -->
                <div>
                    <h2 class="m-0">Upcoming session(s)</h2>
                    <p>Page ID: {{ id }}</p>
                    <div class="flex flex-wrap gap-4 mt-6">

                        {{ if recurrence === 'multi_day' }}

                            {{ days }}
                                <div class=" border-brand-primary-700 border-t-2 border-b-2 min-w-36 bg-brand-neutral-300 ">
                                    <div class="flex flex-col text-brand-primary-700 p-2 justify-center">

                                        <p class="text-center font-bold text-xl mb-0">
                                            {{ date format="d" }} {{ date | format('M') | upper }} {{ date format="Y" }} 
                                        </p>
                                        <p>ID: {{ id }} </p>
                                        <p>Recurrence: {{ recurrence }}</p>
                                        <p class="text-center text-brand-primary-700 mt-2 mx-2 mb-0">
                                            {{ if all_day }}All day{{ else }}{{ start_time | format('g:ia') }}-{{ end_time | format('g:ia') }}{{ /if }}
                                        </p>

                                    </div>
                                </div>
                            {{ /days }}

                        {{ elseif recurrence !== 'none' }}

                            {{ events:upcoming limit="{ sessions_to_display ?? 4 }" :event="id" collapse_multi_days="false" }}

                                <div class=" border-brand-primary-700 border-t-2 border-b-2 min-w-36 bg-brand-neutral-300 ">
                                    <div class="flex flex-col text-brand-primary-700 p-2 justify-center">

                                        <p class="text-center font-bold text-xl mb-0">
                                            {{ start format="d" }} {{ start | format('M') | upper }} {{ start format="Y" }}
                                        </p>
                                        <p>ID: {{ id }} </p>
                                        <p>Recurrence: {{ recurrence }}</p>
                                        <p class="text-center  text-brand-primary-700 mt-2 mx-2 mb-0">
                                            {{ if all_day }}All day{{ else }}{{ start_time | format('g:ia') }}-{{ end_time | format('g:ia') }}{{ /if }}
                                        </p>

                                    </div>
                                </div>

                            {{ /events:upcoming }}

                        {{ else }}

                            <div class=" border-brand-primary-700 border-t-2 border-b-2 min-w-36 bg-brand-neutral-300">
                                <div class="flex flex-col text-brand-primary-700 p-2 justify-center">

                                    <p class="text-center font-bold text-xl mb-0">
                                        {{ start_date format="d" }} {{ start_date | format('M') | upper }} {{ start_date format="Y" }}
                                    </p>
                                    <p>ID: {{ id }} </p>
                                    <p>Recurrence: {{ recurrence }}</p>
                                    <p class="text-center text-brand-primary-700 mt-2 mx-2 mb-0">
                                        {{ if all_day }}All day{{ else }}{{ start_time | format('g:ia') }}-{{ end_time | format('g:ia') }}{{ /if }}
                                    </p>

                                </div>
                            </div>

                        {{ /if }}

                    </div>
                </div>
                <!-- /Upcoming sessions -->

This works correctly for anything that doesn't use the {{ events:upcoming }} tag. But for daily / weekly etc, it lists all upcoming occurrences regardless of entry ID.

Image

This isn't happening in version 5.8.3 as far as I can tell.

Image

Is there new syntax, or something I have done wrong in my Antlers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions