Support

Home Forums Event Espresso Premium Turn off EEH Debug Tools notices

Turn off EEH Debug Tools notices

Posted: June 6, 2019 at 5:51 am

Viewing 2 reply threads


ARAGATO

June 6, 2019 at 5:51 am

I am doing a registration get all call before the init (in the “plugins_loaded” hook to be exact).

$registrations = EEM_Registration::instance()->get_all( array(
       'order_by' => array('REG_ID' => 'DESC'),
   )
);

That generates an ton of those notices:
Notice: EE_WP_User_Field::get_default_value was called incorrectly. You cant get a default value for a wp_User_Field because the "init" action is called, because current_user global hasnt yet been setup. Consider doing your business logic on the "init" hook or later. (This message was added in version 4.6.20 of Event Espresso) in /srv/www/acms-aragato-development/public_html/acms-data/plugins/event-espresso-core-reg/core/helpers/EEH_Debug_Tools.helper.php on line 289

In general the EE Debug Helper tools are very welcome as they generate useful debug responses. However, this time around they are just spamming my error log.

Is there a way to turn off certain EE Debug Tool notices?
Or do you see a possibility to actually get rid of the notices by solving this issue?

I thought about doing a normal wpdb query, which I do not prefer over your awesome EE Model queries. Would that solve it?


Josh

  • Support Staff

June 6, 2019 at 8:54 am

Is there a way to turn off certain EE Debug Tool notices?

Set WP_DEBUG to false.

You’d probably get a similar error/warning if you use wpdb (because the current_user global isn’t set up yet). If you check this reference:

https://codex.wordpress.org/Plugin_API/Action_Reference

You’ll note that plugins_loaded happens before set_current_user. So the earliest hook point you can use in this case is init.


ARAGATO

June 6, 2019 at 10:06 am

I tried the wpdb version and it worked.
No notices.

Thanks anyway.

Viewing 2 reply threads

The support post ‘Turn off EEH Debug Tools notices’ 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