Support

Home Forums Event Espresso Premium Registration error

Registration error

Posted: October 14, 2021 at 12:29 pm


bhhsflpg

October 14, 2021 at 12:29 pm

I have had multiple reports of users receiving this error when trying to register for an event: “There has been a critical error on this website. Learn more about troubleshooting WordPress.” Including a screenshot below.

After doing some testing, it looks like this is user error due to not selecting their ticket type before clicking the Register button. Knowing that people are people, and they don’t like to read, hoping there’s a better way to handle this error rather than redirecting to such a nondescript page. Assuming since multiple people have reported the problem, more will do the same thing in the future.

Screenshot:
https://www.dropbox.com/s/jcp2lwaqfk7zzby/Screen%20Shot%202021-10-14%20at%202.24.03%20PM.png?dl=0

Event link issue reported on:
https://blog.mycabcorner.com/events/ceo-workshop-2021/

Any ideas?


Tony

  • Support Staff

October 14, 2021 at 1:55 pm

Hi there,

We’ll need the error being thrown to fix that as it’s not normal, it should show a notice and not throw an error.

If you edit your sites wp-config.php file and add this:

https://eventespresso.com/wiki/troubleshooting-checklist/#wpdebug

You should already have something like define( 'WP_DEBUG', false); and the above snippet would replace that, however, I think you may already have this code in your wp-config.php but with WP_DEBUG set to false so check before pasting it in.

Let me know when that’s in place and I’ll run a test on the site.


bhhsflpg

October 14, 2021 at 3:01 pm

Hi,

Just updated it to include what you provided.

Thanks,
Stephanie


Tony

  • Support Staff

October 14, 2021 at 3:46 pm

Hi Stephanie,

It’s from the custom code I gave you in your other thread:

https://eventespresso.com/topic/auto-registering-for-additional-events/#post-327251

I’ve updated the gist to include an additional check, pleas update the code on your end to match which should prevent the error.

https://gist.github.com/Pebblo/42a6755ac618e2f3b88c6b945c08ff53#file-tw_ee_add_additional_regs_to_cart-php-L5-L8


bhhsflpg

October 14, 2021 at 3:53 pm

Thanks Tony! I’ve updated it.Is it possible for you to run your test again to make sure we’re good?

I made sure to add these lines you gave me back after updating the code to that latest version

if(
$category instanceof EE_Term
&& $category->ID() == 61
&& $datetime instanceof EE_Datetime
) {


Tony

  • Support Staff

October 14, 2021 at 4:04 pm

It looks like you’ve added the above code twice.

The error currently being thrown is:

PHP Fatal error: Cannot redeclare tw_ee_add_additional_regs_to_cart() (previously declared in /wp-content/plugins/customEEplugin/customEEplugin_alldayevents.php:129) in /wp-content/plugins/customEEplugin/customEEplugin_alldayevents.php on line 186

Remove the snippet from the bottom of the plugin and edit the one at the top to match πŸ™‚


bhhsflpg

October 14, 2021 at 4:07 pm

Whoops, forgot to remove the one I kept as a reference. Just resaved. Did that work?


Tony

  • Support Staff

October 14, 2021 at 4:14 pm

Yep, that’s fixed it, and the notices work, and the functionality still works as expected as far as I can tell πŸ™‚


bhhsflpg

October 14, 2021 at 4:25 pm

Fantastic, thank you!


Tony

  • Support Staff

October 15, 2021 at 4:05 am

You’re most welcome πŸ™‚

The support post ‘Registration error’ 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