Support

Home Forums Event Espresso Premium An error occurred while trying to retrieve the ticket selections for the event.

An error occurred while trying to retrieve the ticket selections for the event.

Posted: December 3, 2021 at 1:04 pm


mlevison

December 3, 2021 at 1:04 pm

Users are getting the following message after selecting a ticket quantity and clicking the “Register Now” button.

“The following errors have occurred:
An error occurred while trying to retrieve the ticket selections for the event.
Please click the back button on your browser and try again.
You need to select a ticket quantity before you can proceed.”

This started happening since that latest update to Version 4.10.21.p last night.

Similar support questions have suggested disabling object caching and I have disabled that now even though it has been active for quite some time and wasn’t causing any problems.

I have also cleared the cache in WP Rocket and opened an incognito window but the error persists.


Tony

  • Support Staff

December 3, 2021 at 2:26 pm

Hi there,

Do were you using version 4.10.20.o prior to the update or have you jumped a versions numbers?

Can you link me to the event so I can take a look?


mlevison

December 3, 2021 at 2:42 pm

All of our plugins update nightly via an automated process and I receive an email after it has completed. Interestingly the email from last night states that it updated from 4.10.19 to 4.10.20 but the WordPress plugin interface shows us as being on version 4.10.21.

It is throwing the same error for all of our events and here is a link to one of them:
https://agilepainrelief.com/courses/virtual-20220120cspo


Tony

  • Support Staff

December 3, 2021 at 4:34 pm

Interestingly the email from last night states that it updated from 4.10.19 to 4.10.20 but the WordPress plugin interface shows us as being on version 4.10.21.

Just to explain this a little, the version check happens every 12 hours. So if we release multiple versions before the version check runs your site can say X but then the update may actually be Y.

It is throwing the same error for all of our events and here is a link to one of them:
https://agilepainrelief.com/courses/virtual-20220120cspo

Thank you, so the problem is the ticket selector has a hidden input which is output and it’s a count of tickets. On the event above it shows 6 tickets but should be 3.

Are you filtering the tickets at all with custom code?

Can you post a screenshot of the Event Tickets & Datetime section?

Or if I can take a quick look over the event itself to see what stands out that may be quicker. If that’s ok you can send temp login details using:

https://eventespresso.com/send-login-details/

Either method is fine with me.


Tony

  • Support Staff

December 3, 2021 at 5:37 pm

Thank you! That made it really easy to find the issue.

The issue is due to the admin only tickets on the event (although it’s not limited to that plugin) and the fact that EE now compares the ‘rows’ of tickets when submitted.

In short, the ticket selector for the event you linked me to is expecting 6 ticket types (ticket rows), that’s the ticket count for that event. The above add-on (although again it isn’t limited to that add-on) is hooking in and filtering out ‘admin only’ tickets on the fly, so EE is expecting 6 tickets, 3 are being output, it’s processing those 3 and then throwing an error because the rows don’t match what it expects.

We will need to push an update for Event Espresso to fix this, I’ve created a ticket for it.

In the meantime, if you are comfortable with PHP there is a quick change you can make to the plugin to skip the row check if you prefer to do that? (As the fix will be included in the next version of EE, it doesn’t matter that you will be modifying the core files in this case as they’ll all be overwritten on the next update anyway)


mlevison

December 3, 2021 at 7:05 pm

Thanks for figuring it out, Tony.

I am comfortable with PHP and can make the change to the core file. Which file and line number am I looking for?


Tony

  • Support Staff

December 4, 2021 at 7:39 am

The easiest change is:

\event-espresso-core-reg\modules\ticket_selector\ProcessTicketSelectorPostData.php

Line 184:

if (empty($row_qty) || ! is_array($row_qty) || $rows !== count($row_qty)) {

Change that to:

if (empty($row_qty) || ! is_array($row_qty)) {

That basically bypasses the check and allows the selection through.

It’s different from the fix we’ll use in the next release but should get you up and running for now.


mlevison

December 4, 2021 at 8:17 am

Thanks for the fix, Tony. I really appreciate that you responded outside of normal business hours to provide a solution.

The fix was easy to implement and I first confirmed that it worked as expected on our staging site before applying it to the production site.


Tony

  • Support Staff

December 7, 2021 at 6:38 am

You’re most welcome, I’m glad it worked to get you back up and running.

I’ve just pushed v4.10.22.p live which includes a (different) fix for this issue.

If you don’t see the update available on the site go to Event Espresso -> General Settings and hit save to force an update check.

The support post ‘An error occurred while trying to retrieve the ticket selections for the event.’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso