Posted: 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 |
|
Hi there, What version of Event Espresso are you using, what version of PHP do you have on your website? |
|
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 |
|
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 |
|
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? |
|
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 |
|
This reply has been marked as private. | |
I dropped all the way back to PHP 7.4.33 and it is working. |
|
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? |
|
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. |
|
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. |
|
Thank you for your help at least it is created now. |
|
Oh that is what was happening, with the advanced editor I can not edit tickets or reorder them. |
|
What specific changes are you making and what happens? |
|
Adding more information to the tickets themselves and putting them in the right order. |
|
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? |
|
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. |
|
The issue with the advanced editor is due to the time format used on the site. Dashboard -> Settings -> General. The time format is The It will remove the timezone being output on the frontend but the advanced editor should work. |
|
Wow, that is really strange. Ok I have removed the timezone for now. |
|
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 |
|
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 |
|
What browser do you use? |
|
I’m using Chrome |
|
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 |
|
Sorry, I’m not sure what you mean by show in block here? |
|
I would like the answers to be shown in line ie yes and no on one line. All answers in one line not downward: Not |
|
Oh so display display inline, you can use something like this:
|
|
Thank you should I mark this resolved or wait till you guys get the fix for the PHP 8 |
|
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. |
|
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.