Support

Home Forums Event Espresso Premium TypeError thrown when viewing event with waitlist

TypeError thrown when viewing event with waitlist

Posted: November 24, 2021 at 7:39 am

Viewing 9 reply threads


neigd72

November 24, 2021 at 7:39 am

Hi,

I have an event with a wait list that’s currently running. When I try to view it as an end user, I get the following error:

Argument 2 passed to EventEspresso\WaitList\domain\services\forms\WaitListForm::__construct() must be of the type array, null given

You can see the page here:

https://rawumberstudios.com/events/figure-painting-with-luca-indraccolo-november-2021/

Any ideas?

Thanks!


Tony

  • Support Staff

November 24, 2021 at 7:55 am

Hi there,

That’s strange! The error means the waitlist add-on couldn’t find tickets for the event to display on the form.

Can you add a screenshot of your Event Datetimes & Tickets section so I can take a look?

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

Note you can set your reply private so only EE staff can view it.


neigd72

November 24, 2021 at 8:27 am

This reply has been marked as private.


neigd72

November 24, 2021 at 8:30 am

This reply has been marked as private.


Tony

  • Support Staff

November 24, 2021 at 11:01 am

Hmm, yeah thats really strange, I can’t reproduce this.

Do you have the full stack trace for the above error? It’ll usually be within your sites error logs, or if you add this snippet to your sites wp-config.php file:

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

In place of what is normally just:

define( 'WP_DEBUG', false );

That will log errors to a location I can view them.


neigd72

November 24, 2021 at 1:20 pm

Hi Tony,

Thanks for the reply! For some reason the stack trace isn’t being logged, but I’ve done a bit of investigation and I’ve noticed 2 things:

a) This used to work in a previous version of EE4
b) I think it’s because the event is in the past, so EE_Event->active_tickets() is returning a 0 length array, so WaitListFormHandler->generate() is failing on line 95

The call stack being:

WaitListFormHandler.php!EventEspresso\WaitList\domain\services\forms\WaitListFormHandler->generate() Line 98 PHP
FormHandler.php!EventEspresso\core\libraries\form_sections\form_handlers\FormHandler->formIsValid() Line 202 PHP
FormHandler.php!EventEspresso\core\libraries\form_sections\form_handlers\FormHandler->form() Line 174 PHP
FormHandler.php!EventEspresso\core\libraries\form_sections\form_handlers\FormHandler->requiresMultipartEnctype() Line 623 PHP
FormHandler.php!EventEspresso\core\libraries\form_sections\form_handlers\FormHandler->display() Line 592 PHP
WaitListMonitor.php!EventEspresso\WaitList\domain\services\event\WaitListMonitor->getWaitListFormForEvent() Line 179 PHP
EED_Wait_Lists.module.php!EED_Wait_Lists::add_wait_list_form_for_event() Line 292 PHP
class-wp-hook.php!WP_Hook->apply_filters() Line 303 PHP
plugin.php!apply_filters() Line 189 PHP
DisplayTicketSelector.php!EventEspresso\modules\ticket_selector\DisplayTicketSelector->displaySubmitButton() Line 666 PHP
DisplayTicketSelector.php!EventEspresso\modules\ticket_selector\DisplayTicketSelector->display() Line 271 PHP
EED_Ticket_Selector.module.php!EED_Ticket_Selector::display_ticket_selector() Line 244 PHP
template_tags.php!espresso_ticket_selector() Line 234 PHP
content-espresso_events-tickets.php!include() Line 7 PHP
EEH_Template.helper.php!EEH_Template::display_template() Line 392 PHP
EEH_Template.helper.php!EEH_Template::locate_template() Line 308 PHP
EED_Event_Single.module.php!EED_Event_Single::event_tickets() Line 397 PHP
class-wp-hook.php!WP_Hook->apply_filters() Line 303 PHP
plugin.php!apply_filters() Line 189 PHP
post-template.php!the_content() Line 253 PHP
EEH_Event_View.helper.php!EEH_Event_View::event_content_or_excerpt() Line 156 PHP
template_tags.php!espresso_event_content_or_excerpt() Line 820 PHP
content-espresso_events-details.php!include() Line 32 PHP
EEH_Template.helper.php!EEH_Template::display_template() Line 392 PHP
EEH_Template.helper.php!EEH_Template::locate_template() Line 308 PHP
EED_Event_Single.module.php!EED_Event_Single::use_filterable_display_order() Line 349 PHP
EED_Event_Single.module.php!EED_Event_Single::event_details() Line 303 PHP
class-wp-hook.php!WP_Hook->apply_filters() Line 303 PHP
plugin.php!apply_filters() Line 189 PHP
post-template.php!the_content() Line 253 PHP
content.php!require() Line 80 PHP
template.php!load_template() Line 772 PHP
template.php!locate_template() Line 716 PHP
general-template.php!get_template_part() Line 204 PHP
single-espresso_events.php!include() Line 21 PHP
template-loader.php!require_once() Line 106 PHP
wp-blog-header.php!require() Line 19 PHP
index.php!{main} Line 17 PHP


Tony

  • Support Staff

November 24, 2021 at 1:55 pm

a) This used to work in a previous version of EE4

Your 100% with that same setup this used to work? The waitlist add-on doesn’t display ‘expired’ tickets (tickets where the sale dates have passed) iirc, only sold out tickets that are technically ‘available’ otherwise.

b) I think it’s because the event is in the past, so EE_Event->active_tickets() is returning a 0 length array, so WaitListFormHandler->generate() is failing on line 95

That event hasn’t passed, it’s currently an ‘Active’ event (now() is between the start date of 2021-11-24 and the end date of 2021-11-26).

You don’t have any active tickets for the waitlist add-on to display (the end date of the ticket is 2021-11-23) so your right, the above call for active_tickets() wouldn’t return that ticket…

However, as you don’t have any active tickets the ticket selector shouldn’t be displaying anyway and the waitlist add-on wouldn’t be called. With that setup, it should show a message stating ticket sales had ended.


neigd72

November 24, 2021 at 2:19 pm

I’m pretty sure it used to work in a previous version.

I have been using a child theme to override some of the pages, so it’s possible I’ve messed something up somewhere.

If I had to guess, it’s because this event is a multi-day event that is currently running, so it’s started but not finished, and has a wait list.

I’m happy to send you a backup of my site if that would help?


Tony

  • Support Staff

November 25, 2021 at 4:01 am

Thank you for the offer, but I’ve managed to reproduce this with fresh eyes.

It happens when the ticket selector is set to display expired tickets and did indeed work prior to a recent update.

I’ve created a ticket to investigate this further and will post the findings here.


Tony

  • Support Staff

November 25, 2021 at 4:31 am

On further investigation with previous versions, although the waitlist option showed up on the page it couldn’t actually be used as no tickets are available in the ‘preferred option’ section.

See here: https://monosnap.com/file/sTGkfJ65yNrgGJIxe6yzqn1wEXy24T

The waitlist option should likely not show at all with that set up as there are no tickets available.

Viewing 9 reply threads

The support post ‘TypeError thrown when viewing event with waitlist’ 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