Support

Home Forums Event Espresso Premium There has been a critical error on this website.

There has been a critical error on this website.

Posted: April 12, 2023 at 7:47 am

Viewing 28 reply threads


Ronald Garrison

April 12, 2023 at 7:47 am

I am adding a new event and i keep receiving this error.

I see this in the logs when I try to edit the event
17540#0: *482820 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, int given in /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php:2038
Stack trace:
#0 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php(2038): in_array()
#1 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php(1605): espresso_events_Pricing_Hooks->_get_ticket_datetime_list_item()
#2 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php(1094): espresso_events_Pricing_Hooks->_get_ticket_row()
#3 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-admin/i” while reading response header from upstream


Garth

  • Support Staff

April 12, 2023 at 10:26 am

Hi there,

What version of Event Espresso are you using, what version of PHP do you have on your website?


Ronald Garrison

April 13, 2023 at 4:51 am

I have tried both PHP 8.2.4 and 8.1.17 and both are having the issue.

Event Espresso: Version 5.0.3.p


Ronald Garrison

April 13, 2023 at 5:00 am

I also saw this in the email I received about the crash:

WordPress version 6.2 Active theme: Vantage (version 1.20.8) Current plugin: Event Espresso (version 5.0.3.p) PHP version 8.2.4 Error Details ============= An error of type E_ERROR was caused in line 1192 of the file /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php. Error message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, int given in /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php:2038 Stack trace: #0 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php(2038): in_array() #1 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php(1605): espresso_events_Pricing_Hooks->_get_ticket_datetime_list_item() #2 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php(1094): espresso_events_Pricing_Hooks->_get_ticket_row() #3 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-admin/includes/template.php(1445): espresso_events_Pricing_Hooks->pricing_metabox() #4 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-admin/edit-form-advanced.php(688): do_meta_boxes() #5 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_CPT.core.php(1410): include_once(‘…’) #6 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_CPT.core.php(1471): EE_Admin_Page_CPT->loadEditorTemplate() #7 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(1184): EE_Admin_Page_CPT->_edit_cpt_item() #8 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_CPT.core.php(402): EE_Admin_Page->_route_admin_request() #9 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(783): EE_Admin_Page_CPT->_load_page_dependencies() #10 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/class-wp-hook.php(308): EE_Admin_Page->load_page_dependencies() #11 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #12 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #13 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-admin/admin.php(237): do_action() #14 {main} Next RuntimeException: Page route “_edit_cpt_item” with the supplied arguments () threw the following exception: in_array(): Argument #2 ($haystack) must be of type array, int given in /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php:1192 Stack trace: #0 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_CPT.core.php(402): EE_Admin_Page->_route_admin_request() #1 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(783): EE_Admin_Page_CPT->_load_page_dependencies() #2 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/class-wp-hook.php(308): EE_Admin_Page->load_page_dependencies() #3 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #4 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #5 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-admin/admin.php(237): do_action() #6 {main} thrown


Tony

  • Support Staff

April 13, 2023 at 9:15 am

Hi there,

Officially we don’t support PHP8.1+ at this time as there’s a bunch of breaking changes within PHP8.1 (deprecated functions removed).

Can you try the above using PHP8.0.XX and see if you get the same error?


Ronald Garrison

April 13, 2023 at 10:52 am

I have gone back to 8.0.28 and I still am receiving the error.

WordPress version 6.2 Active theme: Vantage (version 1.20.9) Current plugin: Event Espresso (version 5.0.3.p) PHP version 8.0.28 Error Details ============= An error of type E_ERROR was caused in line 1192 of the file /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php. Error message: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, int given in /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php:2038 Stack trace: #0 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php(2038): in_array() #1 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php(1606): espresso_events_Pricing_Hooks->_get_ticket_datetime_list_item() #2 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/caffeinated/admin/new/pricing/espresso_events_Pricing_Hooks.class.php(1095): espresso_events_Pricing_Hooks->_get_ticket_row() #3 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-admin/includes/template.php(1445): espresso_events_Pricing_Hooks->pricing_metabox() #4 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-admin/edit-form-advanced.php(688): do_meta_boxes() #5 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_CPT.core.php(1410): include_once(‘…’) #6 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_CPT.core.php(1471): EE_Admin_Page_CPT->loadEditorTemplate() #7 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(1184): EE_Admin_Page_CPT->_edit_cpt_item() #8 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_CPT.core.php(402): EE_Admin_Page->_route_admin_request() #9 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(783): EE_Admin_Page_CPT->_load_page_dependencies() #10 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/class-wp-hook.php(308): EE_Admin_Page->load_page_dependencies() #11 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #12 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #13 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-admin/admin.php(237): do_action() #14 {main} Next RuntimeException: Page route “_edit_cpt_item” with the supplied arguments () threw the following exception: in_array(): Argument #2 ($haystack) must be of type array, int given in /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php:1192 Stack trace: #0 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_CPT.core.php(402): EE_Admin_Page->_route_admin_request() #1 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page.core.php(783): EE_Admin_Page_CPT->_load_page_dependencies() #2 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/class-wp-hook.php(308): EE_Admin_Page->load_page_dependencies() #3 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #4 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() #5 /var/www/vhosts/indianaroyalarchmasons.org/httpdocs/wp-admin/admin.php(237): do_action() #6 {main} thrown


Ronald Garrison

April 13, 2023 at 10:56 am

This reply has been marked as private.


Ronald Garrison

April 13, 2023 at 2:09 pm

I dropped all the way back to PHP 7.4.33 and it is working.


Tony

  • Support Staff

April 13, 2023 at 3:18 pm

The error you are getting is really weird because within the code we make sure the values are arrays before we use them (which is what the error is referring to), although the value of the array may be something unexpected which is apparently ‘ok’ in PHP7 but not in PHP8 (PHP8 introduces stricter types).

I had a quick look at your site and checked the event but even when copying your setup, I don’t get any errors when testing this.

Have you tried using the new advanced editor?

Event Espresso -> Events -> Default Settings

Set ‘Activate Advanced Editor?’ to ‘Advanced Editor’ and save.

If you then try and edit your event with PHP8 do you get the same issue?


Ronald Garrison

April 13, 2023 at 3:43 pm

I had switched back to the old editor when trying to figure this out. I just put back to PHP 8.0.28 with the advanced editor and it works now.


Tony

  • Support Staff

April 13, 2023 at 3:49 pm

Somewhere along the way I think your ticket assignments were messed up, switching back down to PHP7.4 has allowed whatever data is in use to be ‘valid’ and updated in the background when updating the event.

Now the data is ‘valid’ the error isn’t throwing.

Very strange error to have but without being able to reproduce this I can only guess currently.


Ronald Garrison

April 13, 2023 at 3:58 pm

Thank you for your help at least it is created now.


Ronald Garrison

April 13, 2023 at 4:07 pm

Oh that is what was happening, with the advanced editor I can not edit tickets or reorder them.


Tony

  • Support Staff

April 13, 2023 at 4:17 pm

What specific changes are you making and what happens?


Ronald Garrison

April 14, 2023 at 4:47 am

Adding more information to the tickets themselves and putting them in the right order.


Tony

  • Support Staff

April 14, 2023 at 5:24 am

That’s too broad to help.

Adding information to what? The ticket title, description, both? Changing the price?

How are you putting them in order? To set the order you need click the re-order button and manually set the order, then click Submit on the modal for the update to work.

Can I create a test event on the site to try updating tickets?


Ronald Garrison

April 14, 2023 at 5:40 am

Sorry, description. The reorder button was hidden until I clicked hide filters button. So I have them reordered.

When I click the three line button then click edit ticket the screen refreshes and the tickets are not even visible. I am uses firefox should I be using a different browser?

Yes feel free to create a test event.


Tony

  • Support Staff

April 14, 2023 at 7:11 am

The issue with the advanced editor is due to the time format used on the site.

Dashboard -> Settings -> General.

The time format is g:i a T

The T at the end is breaking the advanced editor and I’ve created a ticket to investigate that further, but to get it working now you can set the format to be g:i a.

It will remove the timezone being output on the frontend but the advanced editor should work.


Ronald Garrison

April 14, 2023 at 7:39 am

Wow, that is really strange. Ok I have removed the timezone for now.


Ronald Garrison

April 14, 2023 at 7:58 am

I am not sure if this is by design, but when I try to edit the the event box it puts it all in one long string if you try to edit by text


Tony

  • Support Staff

April 14, 2023 at 8:27 am

Hmm, strange. I’m not getting that on your site.

When I switch to text mode it displays like this: https://monosnap.com/file/HPg255DBWjGRgiL1oNn40PEeose0B9


Ronald Garrison

April 14, 2023 at 8:33 am

What browser do you use?


Tony

  • Support Staff

April 14, 2023 at 9:23 am

I’m using Chrome


Ronald Garrison

April 14, 2023 at 10:28 am

Ok with chrome this is working. Firefox it does not.

One more question is there an easy way and do you know the css code to have custom question checkboxes show in block and not Events


Tony

  • Support Staff

April 14, 2023 at 12:03 pm

Sorry, I’m not sure what you mean by show in block here?


Ronald Garrison

April 14, 2023 at 12:51 pm

I would like the answers to be shown in line ie yes and no on one line.

All answers in one line not downward:
Yes No

Not
Yes
No


Tony

  • Support Staff

April 17, 2023 at 6:04 am

Oh so display display inline, you can use something like this:


.ee-checkbox-multi-input-dv .ee-checkbox-label-after {
    display: inline!important;
}


Ronald Garrison

April 17, 2023 at 8:10 am

Thank you should I mark this resolved or wait till you guys get the fix for the PHP 8


Tony

  • Support Staff

April 17, 2023 at 8:32 am

If your server is running PHP8 again and no error is being thrown there isn’t a fix we can push for the above.

‘Something’ was wrong with the ticket assignments but it’s now fixed (otherwise you’d still be getting the error) so we don’t know what to fix anymore.

If you’re not currently running into any issues, mark this thread resolved and always open another if you do.

The date/time format issue we have an open ticket to fix in a future version.

Viewing 28 reply threads

The support post ‘There has been a critical error on this website.’ 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