Support

Home Forums Event Espresso Premium EEM_Attendee model can not be loaded before the "AHEE__EE_System__load_espresso_

EEM_Attendee model can not be loaded before the "AHEE__EE_System__load_espresso_

Posted: October 14, 2022 at 11:05 am

Viewing 3 reply threads


skillstat

October 14, 2022 at 11:05 am

Hi there,

Im dealing with this error:

Uncaught EE_Error: The EEM_Attendee model can not be loaded before the “AHEE__EE_System__load_espresso_addons” hook has been called. This gives other addons a chance to extend this model.

The stack trace is cut off, but its originating from my own code somewhere. I use EEM_Attendee a couple times like
EEM_Attendee::instance()->get_one_by_ID($aid); and
EEM_Attendee::instance()->find_existing_attendee($args);

Im assuming to fix this I need to add an initialization call; perhaps its something like EE_Registry::instance()->load_***???

Here is the stack trace
—————————————————————————
An error of type E_ERROR was caused in line 558 of the file /var/www/html/skillstat.com/htdocs/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php. Error message: Uncaught EE_Error: The EEM_Attendee model can not be loaded before the “AHEE__EE_System__load_espresso_addons” hook has been called. This gives other addons a chance to extend this model. in /var/www/html/skillstat.com/htdocs/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php:558 Stack trace: #0 /var/www/html/skillstat.com/htdocs/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Soft_Delete_Base.model.php(40): EEM_Base->__construct() #1 /var/www/html/skillstat.com/htdocs/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_CPT_Base.model.php(147): EEM_Soft_Delete_Base->__construct() #2 /var/www/html/skillstat.com/htdocs/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Attendee.model.php(294): EEM_CPT_Base->__construct() #3 /var/www/html/skillstat.com/htdocs/wp-content/plugins/event-espresso-core-reg/core/db_models/EEM_Base.model.php(745): EEM_Attendee->__construct() #4 /var/www/html/skillstat.com/htdocs/wp-content/plugins/ss-eewc-bridge/SS_open.php?u=30343202&id=3edb0d4e5558428cb2a5b1db269f7bc6
————————————————————————

Thanks
Morgan


Tony

  • Support Staff

October 14, 2022 at 2:02 pm

Hi there,

Im assuming to fix this I need to add an initialization call; perhaps its something like EE_Registry::instance()->load_***???

Not really, you need to run your code after the AHEE__EE_System__load_espresso_addons hook has been called which is basically what that error message is showing, when are you running your code currently?


skillstat

October 14, 2022 at 7:13 pm

Unfortunately, because the stack trace was cutoff in the email report, I don’t know for sure. But have a hunch its from within the admin_notices hook.


Tony

  • Support Staff

October 15, 2022 at 8:27 am

Do you not have a working copy locally?

For example, if you use XDebug you’ll get a much better stacktrace than the one built into PHP.

The issue above is not due to needing to initialize a class but rather your code is running ‘too early’ so the code needs to be moved to the correct hook, but to know what that is we need to know where the code is running already.

Viewing 3 reply threads

The support post ‘EEM_Attendee model can not be loaded before the "AHEE__EE_System__load_espresso_’ 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