Support

Home Forums Event Espresso Premium Fatal Error when Updating a Published Event back to Draft

Fatal Error when Updating a Published Event back to Draft

Posted: September 23, 2022 at 7:12 am


fuzzyminds

September 23, 2022 at 7:12 am

Hello,

We use EE with many of its add-ons, specifically the WP Users add-on as well. All the EE plugins are at the latest version and the PHP version in our prod is 7.4. Whenever we try to revert a Published Event back to Draft status, the page throws the following error:

PHP Fatal error: Uncaught TypeError: Argument 1 passed to EED_WP_Users_Admin::save_wp_user_event_setting() must be an instance of EE_Event, null given, called in /webroot/www/html/wp-content/plugins/event-espresso-core-reg/admin_pages/events/Events_Admin_Page.core.php on line 1054 and defined in /webroot/www/html/wp-content/plugins/eea-wp-user-integration/EED_WP_Users_Admin.module.php:931
Stack trace:
#0 /webroot/www/html/wp-content/plugins/event-espresso-core-reg/admin_pages/events/Events_Admin_Page.core.php(1054): EED_WP_Users_Admin::save_wp_user_event_setting()
#1 /webroot/www/html/wp-content/plugins/event-espresso-core-reg/core/admin/EE_Admin_Page_CPT.core.php(1025): Events_Admin_Page->_insert_update_cpt_item()
#2 /webroot/www/html/wp-includes/class-wp-hook.php(307): EE_Admin_Page_CPT->insert_update()
#3 /webroot/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#4 /webroot/www/html/wp-includes/plugin.php(476): WP_Hook->do_action()
#5 /webroot/www/html/wp-includes/post.php(4673): do_action()
#6 /webroo in /webroot/www/html/wp-content/plugins/eea-wp-user-integration/EED_WP_Users_Admin.module.php on line 931

Any help regarding this error, would be greatly appreciated. Specially if this error is specific to our environment.


Tony

  • Support Staff

September 26, 2022 at 5:31 am

Hi there,

So, this is a strange error for a couple of reasons.

We hook into the WP core save_post, doa bunch of checks and additional processing, then call an EE Admin page method _insert_update_cpt_item()

Which again does some additional checks and then calls any callback functions we want to run to update various sections. The fact that you are getting the above error means all of the additional processing worked as expected, and apparently the ‘default’ callbacks all worked but the callback for the WP user integration add-on did not have a valid event passed to it.

Now, it works as expected when I test this (on multiple PHP versions) which is why this is odd.

We filter the above callbacks using:

FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks

So my first question is, do you have any custom code hooking into the above?

If I recall correctly from previous threads, either you or someone on your team is comfortable with PHP, correct?


fuzzyminds

September 26, 2022 at 9:39 am

Thank you for the initial explanation Tony.

Yes we do have a full-stack developer who works with PHP, we are not using the hook you mentioned anywhere. These are the hooks we have customized around:

AHEE__EE_Payment_Processor__update_txn_based_on_payment__successful
AHEE__Transactions_Admin_Page__apply_payments_or_refund__after_recording
AHEE__Single_Page_Checkout__process_reg_step__attendee_information__process_reg_step

Is it possible that this error is due to a faulty or missing value in the Database? And if so, would removing and reinstalling the WP Users help?


Tony

  • Support Staff

September 29, 2022 at 2:27 am

These are the hooks we have customized around

I don’t think any customization on those hooks would cause this.

Is it possible that this error is due to a faulty or missing value in the Database?

Possibly, but it seems unlikely in this case.

And if so, would removing and reinstalling the WP Users help?

Not with this specific issue, no.

Is this event published publicly or private?


fuzzyminds

September 29, 2022 at 12:05 pm

The problem is occurring with Published Events. And it’s not just one event, but all of the published events bring up this error.


Tony

  • Support Staff

September 29, 2022 at 12:53 pm

Are the events published privately or public?

In the ‘Update Event’ meta box, does it show ‘Privately Published’?


fuzzyminds

September 30, 2022 at 11:24 am

No, they are all public.

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso