• Resolved sudopeople

    (@sudopeople)


    When I export my bookings the CSV grows to a very large amount and it’s all duplicates. I only have one booking in there and there end up being hundreds of the same row. I can tell that it’s in an infinite loop, the end of the CSV file has a timeout error.

    Fatal error: Maximum execution time of 30 seconds exceeded in /wordpress/wp-includes/plugin.php on line 0

    I’ve edited em-actions.php and commented out the while loop I believe to be responsible:

    $handle = fopen("php://output", "w");
    //while(!empty($EM_Bookings->bookings)){
      [...foreach loops left uncommented...]
      //$EM_Bookings_Table->offset += $EM_Bookings_Table->limit;
      //$EM_Bookings = $EM_Bookings_Table->get_bookings();
    //}

    and all seems to be working well. I honestly have no idea what I just did, but I’m pretty sure I’ll be missing something at some point…the offset and reassignment of $EM_Bookings looks ominous.

    Using events-manager.5.2.5

    https://www.ads-software.com/extend/plugins/events-manager/

Viewing 8 replies - 1 through 8 (of 8 total)
  • thanks, am going to check this out; also, can I know how many bookings you are trying to export and is these using all events or future events only? and did you try to adjust this line $EM_Bookings_Table->limit = 150;

    Thread Starter sudopeople

    (@sudopeople)

    I did not mess with the limit = 150, although I took note of the setting. I didn’t bother since the while loop in addition to the foreach loops seems superfluous.

    I was exporting exactly one booking, and it was for a specific event. I went to the event edit page, and below, in the Bookings/Registration area, clicked the View Bookings link next to the ticket I created.

    The while loop may loop through multiple events, and as such is not actually needed for a single event and single ticket.

    I see no way to export bookings for all events as you asked. From Events > Bookings I’ve got to click an event before I can export. To answer that question simply, it’s for a future event.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    i’m not getting this issue….

    however, not sure if we’re in the same place, are you exporting something after clicking view/edit for a specific booking (not event)?

    Thread Starter sudopeople

    (@sudopeople)

    Yeah, i have a way of trying to provide max info and convoluting the hell out of things. I’ll spell it out the best I can.

    In WP Admin I click Events.
    I click an event (taking me to the Edit page for it).
    Below the event textarea there’s a section called Bookings/Registration with a couple of “tickets” listed.
    I click View Bookings next to the one ticket with one booking.
    It opens a page listing the one booking in the system.
    I click the CSV icon and wait 30 seconds until a csv file is downloaded. When I open the CSV I get hundreds of rows containing the one booking record in the system. At the bottom of the CSV file in a call, is the timeout error.

    To try and cut to the chase, the question I’d ask anyone familiar with the code in question is: What does the outer while loop do? …because the code works as I expect it to without it.

    Let me know if I can clarify any further.

    thanks for the instructions, am going to try this again.

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    will look into this during update of 5.2.7 as .6 is about to be published.

    this is probably limited to exporting csv in a single ticket view, e.g. if you tried exporting your events straight from the bookings dashboard it will probably work, same with exporting a single event.

    Thread Starter sudopeople

    (@sudopeople)

    Excellent.

    I’m content with how it works after my modification. For our purposes each “ticket” has a coordinator, so I need a list per ticket to hand out.

    Thanks for an awesome plugin!

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    I’ve updated the plugin and made a modification to how ticket csv files are generated. problem is I could never recreate this infinite loop problem, even though I could see how it could happen in the code.

    If you could confirm that this works for you now, that’d be appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Events Manager] Bookings CSV Export infinite loop’ is closed to new replies.