Theme Conflict (Venedor) Breaking “Add Another Rule” Button

Home Forums Calendar Products Events Calendar PRO Theme Conflict (Venedor) Breaking “Add Another Rule” Button

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1131728
    Nadim
    Participant

    It seems that my theme, Venedor by SW Themes (using a child theme), doesn’t like something about this plugin. The theme version is 2.4.8. When I go to edit an event, with the intent of making it recurring, I am greeted by this:

    Screencap of the problem

    There is no dropdown present for a first recurrence rule. Note that when I click the “Add Another Rule” button, it reloads the page and says that the page was successfully edited, but no rule gets added. The button effectively does nothing except trigger a lengthy page load.

    When I switched to Twenty Sixteen to test, everything worked fine; there was a default dropdown to start with, and “Add Another Rule” successfully appended more rules when clicked. No page load, just a click to add an additional dropdown – I assume this is the correct behavior. I did not directly deactivate any plugins. All I did was change the active theme to Twenty Sixteen.

    Changing back to Venedor broke the button again, with it behaving exactly as before. When I check the console, it shows the following error (on line 324 in the formatted source):

    Uncaught ReferenceError: tribe_events_linked_posts is not defined

    Any insight into how this might be resolved?

    #1132108
    Nico
    Member

    Hi there Nadmin,

    Thanks for reaching out and sorry to hear about this issue! Let’s look into it…

    If you deactivate the child theme but leave the parent theme active, Do you get the same result? If you are not getting the same we can narrow this to an issue with the child theme.

    Also, was this working until the 4.2 update? If you deactivate WooCommerce Tickets does this behaviour change? On that note is there any reason why you are not switching to Event Tickets and Event Tickets Plus → https://theeventscalendar.com/knowledgebase/moving-to-event-tickets-plus/

    Please let me know about this,
    Best,
    Nico

    #1132236
    Nadim
    Participant

    Good morning Nico,

    I’m afraid the plugin is still not functioning correctly. I have ruled out the child theme’s being the culprit, as the main parent theme by itself still causes the same issue. It is also probably not anything to do with the tickets plugin; after deactivating WooCommerce Tickets there was no change, nor was there after installing and activating Event Tickets Plus instead (though the latter was probably good to do as a matter of housekeeping).

    Unfortunately I can’t provide an answer as to whether it worked prior to 4.2, since I only just installed Recurring Events on Friday – it’s brand new on the site.

    As of now, it still holds true that the only way I’ve gotten the Recurrence Rules menu to function is by switching to Twenty Sixteen, independently of any plugins’ activation/deactivation. This leads me to think it’s very likely that Venedor itself is causing the issue.

    #1132471
    Nico
    Member

    Thanks for the follow-up Nadim! Indeed it looks like the theme is causing this, thanks for testing it out.

    Can you reach out to them to report the issue? I’ll share the error description with our dev team to see if they have any clues on why this is breaking.

    Please let me know if they are aware of the issue or able to provide a solution,
    Best,
    Nico

    #1132537
    Nico
    Member

    Nadim,

    Here’s what the dev team thinks might be causing the issue: “The tribe_events_linked_posts JS variable gets initialized as a wp_localize_script() with jquery as a dependency. If the theme is dequeuing jquery for some reason, that could be the culprit.”

    If that’s the case, this snippet might help:

    function tribe_snippet_localize_linked_posts() {
    wp_localize_script( 'events-admin', 'tribe_events_linked_posts', Tribe__Events__Linked_Posts::instance()->get_post_type_container_data() );
    }

    add_action( 'wp_enqueue_scripts', 'tribe_snippet_localize_linked_posts' );

    Please send over these details to the Venedor support team,
    Thanks,
    Nico

    #1132812
    Nadim
    Participant

    Unfortunately the snippet posted above had no effect on the menu (it would ideally go in functions.php, is that correct?). Would that I were more savvy with WordPress development and could identify where the hiccup is starting!

    I’m afraid I also don’t have access to support for Venedor at the moment – it seems the license for it has expired. I may have to consult with the rest of the team and decide whether we need to purchase a “renewal” on support service for what would likely just be this one issue.

    In the mean time, are there perhaps any other likely suspects that might be causing jQuery to malfunction?

    For what it’s worth, the console tells me that jQuery Migrate is active on that page, and perusing the HTML elements shows me that the dropdown I want to see is embedded in a <script> tag but with a CSS rule of “display:none;” applied by the User Agent Stylesheet. When I override that by styling the element directly, it displays the HTML markup as code rather than formatting it correctly (e.g., it actually shows every “<div>” and “<input>” tag as plaintext).

    #1132906
    Nico
    Member

    Thanks for following up Nadim!

    That code snippet should go in the functions.php file indeed.

    If the Venedor theme ensures compatibility with The Events Calendar you might be able to report this as a bug, but it all depends on how their support policy works.

    In the mean time, are there perhaps any other likely suspects that might be causing jQuery to malfunction?

    I would check for Jquery related stuff in the theme, and queuing/dequeuing javascript in general. It’s hard to tell!

    Regarding the mark up that’s right, the JS code makes it work. Looking for a workaround on that end doesn’t sound like a good idea, as if all scripts are in place this should work as it does with TweentySixteen theme.

    Best,
    Nico

    #1133039
    Nadim
    Participant

    Victory!

    …tentatively. So far, nothing has broken. I’ll post what I did here just in case it might help someone with similar problems, or lead to a better solution. In the child theme’s functions.php, I pasted this:

    
    add_action( 'init' , 'fix_calendar' , 15 );
    function fix_calendar() {
            remove_action('admin_enqueue_scripts', 'venedor_admin_scripts');
            add_action('admin_enqueue_scripts', 'venedor_admin_scripts', 100);
    }
    

    It seems that Venedor was loading a script too early, breaking certain functionality in the Event edit interface. The above snippet removes the initial action on line 871 of Venedor’s (the original theme, not the child theme) functions.php. It then adds it again, with priority 100, to ensure it’s the last thing to load.

    This seems to enable the dropdown for recurrence rules to work correctly.

    #1133554
    Nico
    Member

    Wooot! Great work Nadim and thanks for sharing! I’m sure other users will benefit from this solution in the future 🙂

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Theme Conflict (Venedor) Breaking “Add Another Rule” Button’ is closed to new replies.