• Resolved Hans Schuijff

    (@hanswitteprins)


    Since updating from version 5.12.2 to 5.12.3 my event archive views fail in Genesis framework child themes. I investigated in a dev env and noticed that the conditionals that normally return true now return false. In version 5.12.2 it still works, so there is a change that make the conditionals.

    The code is based on code in the knowledgebase and I have used it for many years now:
    https://theeventscalendar.com/knowledgebase/k/genesis-theme-framework-integration/

    basically it just hooks in the get_header en uses tribe conditionals to determine if the current page is a tec archive page.

    I have tried if the conditionals return their expected value when I use hooks that are fired later than the get_header hook, but same result. Before it worked on the genesis_pre_get_option_site_layout hook and not anymore, and also on the genesis_before_loop hook the conditionals return false instead of true and since genesis theme isn’t able to determine the current page correctly the event list isn’t displayed in the standard theme template.

    The default event template shows the events list correctly, although the layout is then not as adapted for the theme, but until now I could use the standard page template of the theme too. That is now blocked by the wrong response of the conditionals.

    For instance in list view I expect tribe_is_list_view() to return true, but it returns false, and normally also tribe_is_upcoming() returns true, but is now returning false. tribe_is_event_query() returns true, but isn’t specific enough for me to know I’m on an archive.

    Can you help? For now I’m stuck in version 5.12.2 or forced to use the default event template and use less optimal presentation. The genesis framework hasn’t changed, so I would expect no change from there. The installation with the problems are using the updated even views. Another still using the legacy view is still functioning as expected.

    Thanks, Hans

Viewing 13 replies - 1 through 13 (of 13 total)
  • @hanswitteprins I’m having the exact same problem with conditionals in my theme after upgrading to version 5.12.4. For years, I’ve been using tribe_is_upcoming() in my theme and had no issues, but as soon as I make the update it’s returning false when it should be true on multiple sites.

    Have you figured anything out or heard from support?

    Same here – tribe_is_upcoming() fails in 5.12.4

    same here, tribe_is_event() fails with version 5.13.0 as well

    Hi there,

    With the switch to the “V2” templates, the “tribe_is” functions are no longer functioning as expected with these Genesis workarounds.

    I do see a bug ticket open for this, but there is a note saying they would revisit this after the release of The Events Calendar 6.0.

    For now, you would need to stick with the V1 templates (no longer supported) or stay on the older, working version of TEC.

    We have attached this support thread to the bug ticket, and will follow up here when there is any news to share.

    Best,
    Sky

    Internal ref: TEC-4301

    Thread Starter Hans Schuijff

    (@hanswitteprins)

    Hi @skyshab ,

    Thanks for the acknowledgement of the bug. It seems this part of TEC is not ready for v2 and advising to switch back to no longer supported views (that come with warnings that they would be killed as of august 2021) seems a bit odd.

    Since the tribe_is_event_query() is still functioning properly I have for now just used that to check if I’m on a event page, but in the end there should be a functioning way to determine what page a visitor is on.

    That the plugin doesn’t signal that it isn’t working properly might also be a problem. If it is a known bug that is there for many months now, a log warning or something might also be appropriate.

    I hope at some point the bug will be fixed.

    Thanks & regards,

    Hans

    @hanswitteprins

    Hi Hans!

    Yes, I agree that neither of the suggested “workarounds” is ideal.

    Playing around with this, it seems like you might be able to replace those conditionals in the Genesis integration article with is_post_type_archive('tribe_events') instead. This would target all of the main calendar pages. Not sure why that snippet actually uses all of the “tribe_is” functions to begin with.

    Here’s a simplified version of that: https://gist.github.com/skyshab/f6cf554b86d6d14c5a3bbab1b5f030b5

    Let me know if that helps in your scenario.

    Best,
    Sky

    • This reply was modified 2 years, 8 months ago by Sky Shabatura.
    Thread Starter Hans Schuijff

    (@hanswitteprins)

    Hi @skyshab

    I haven’t tested your conditional suggestion, but it might also work. Thanks also for the gist, that solution is already part of my core functionality, but perhaps the other responders still need it.

    My current workaround is enough for deciding when to use the_content instead of the normal genesis loop. Before this I used the more granular version that is suggested in the support pages, but actually for the genesis integration this is enough and I don’t have to know what view the archive uses.

    For anyone the needs the same, here is the code I found to work…

    function is_tec_archive() {
    	if ( ! is_tec_active() ) {
    		return false;
    	}
    	if ( ! \tribe_is_event_query() ) {
    		return false;
    	}
    	if ( \is_singular() ) {
    		return false;
    	}
    	return true;
    
    }
    function is_tec_active() {
    	return class_exists( 'Tribe__Events__Main' );
    }

    Thanks, Hans

    Hi again,

    Great! Glad you were able to figure out a workaround for now.

    We’ll let you know as soon as we have an update that fixes the “tribe_is” conditionals.

    Best,
    Sky

    Plugin Support Abz

    (@abzlevelup)

    Hi @hanswitteprins,

    Since we haven’t heard from you in a while on this topic we will assume that the problem was fixed or is no longer applicable and with that I will mark this as resolved.

    If that is not the case, please let me know, and I will gladly remove the “Resolved” tag and try to help you further. Or you can create a new topic with the problem if you prefer.

    Best,
    Abz

    Thread Starter Hans Schuijff

    (@hanswitteprins)

    Hi @abzlevelup

    There is no reason for more interchange until the tribe_is functions work again. Are they fixed yet?

    regards,
    Hans

    Second. Is it possible to fix these in the upcoming releases?

    Some of the things broke on our websites, especially conditional tags that were dependent on this particular tag tribe_is_upcoming()

    • This reply was modified 2 years, 7 months ago by ajaffri.
    Plugin Support Abz

    (@abzlevelup)

    Hi @hanswitteprins,

    Apologies for tagging this as resolved, we were updating our tagging with the bug tickets — this ticket should not have been included. I would also confirm that internal bug ticket: TEC-4301 is still active.

    I already reached out to our team, and they are still working on a fix. Furthermore, I’d get back to you as soon as I hear from the team.

    Have a great day.

    Best,
    Abz

    Plugin Support Abz

    (@abzlevelup)

    Hi @ajaffri,

    Thanks for reaching out. Apologies for the inconvenience, we do not have any timeline for this one, and I am unable to provide you an exact date for when or if it would be included on the next release.

    Rest assured that our team is working on it, and I’d get back to you on this ticket when there are any updates.

    Appreciate your patience.

    Best,
    Abz

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Tribe_is… conditionals fail in version 5.12.3, so genesis integration fails’ is closed to new replies.