Support » Plugin: Events Manager » “Undefined variable: result_tickets” in saving event in PHP

  • Events Manager 5.8 brought at least two changes that have prevented many cases where we would be able to improve and save events programmatically. One is at https://wordpress.org/support/topic/adding-category-to-event-in-php/, and then there’s this one that activates in the same cases:

    Notice: Undefined variable: result_tickets in wp-content/plugins/events-manager/classes/em-bookings.php on line 315

    This occurs when trying to save an event after creating it and adding categories to it, all in PHP. This persists even after temporarily disabling the category part while waiting for the resolution of the other support ticket linked above. This undefined variable seems like a bug that has appeared in EM 5.8 through to the newest 5.8.1.1 because:

    1. We have always had bookings disabled.
    2. The string result_tickets cannot be found anywhere in our own code. Neither tickets.

    Why is an event that doesn’t make any use of bookings or tickets failing to save due to an undefined result_tickets variable in booking code?

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    can you try the latest EM version 5.8.1.1 ?

    We already do run that. As mentioned above: “This undefined variable seems like a bug that has appeared in EM 5.8 through to the newest 5.8.1.1:”

    On a side note, I’ve suggested to WordPress core meta team that plugin version would be added to the new support request form. They’ve been tackling higher priority items like upgrading the whole forums (which seems to be well accomplished now), so hopefully they’ll get into adding the plugin version field one day. It should help support work considerably.

    Plugin Support caimin_nwl

    (@caimin_nwl)

    Can you test with the latest Dev version?

    I am also getting this error and also not using bookings or tickets. Has it been resolved?

    Plugin Support caimin_nwl

    (@caimin_nwl)

    @betyonfire Which version of Events Manager are you using?

    I’m using 5.8.1.1.

    Still getting the same error with the dev version 5.8.1.21. Only now the error message refers to line 322 of em-bookings.php.

    I get:
    Undefined variable: result_tickets … wp-content/plugins/events-manager/classes/em-bookings.php on line 315

    Plugin Support caimin_nwl

    (@caimin_nwl)

    @daedalon Can you share the custom code section that seems to trigger the error for you?

    @betyonfire & @jabcka Are you using custom code to create events or something similar? If so, does the error disappear if you remove the custom code?

    I’m not using custom code to create events. I imported Events Manager data from one WP site to another, but the location information seems to have gotten messed up and I think that might be what is causing my problem. There were a lot of locations and many duplicates and most are past events, so I deleted them and created a few new locations. But am now getting the error when creating or saving any events. Could the imported locations be causing this and is there a way to fully purge them from the database?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    can I know how did you imported your events or locations?

    I used WP All Import Pro to import from one site to another.

    Plugin Support caimin_nwl

    (@caimin_nwl)

    It sounds like WP All Import Pro hasn’t imported the location tables correctly, meaning that they’re out of sync on your new installation.

    I think the best thing would be to re-import all the events data. Is the new site a fresh install of WordPress or does it have existing content?

    I don’t really need the location information on the new site — do you still think re-importing would be better than trying to remove location info?

    The new site does have existing content in it. I’m going to pull a copy of the database and files and get them set up locally so I can work out this issue. If you have an idea of how to re-import correctly (or another fix that would remove location info), I’d love to hear it.

    I don’t really need the location information on the new site — do you still think re-importing would be better than trying to remove location info?

    The new site does have existing content in it. I’m going to pull a copy of the database and files and get them set up locally so I can work out this issue. If you have an idea of how to re-import correctly (or another fix that would remove location info), I’d love to hear it.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘“Undefined variable: result_tickets” in saving event in PHP’ is closed to new replies.