We’ve been using a custom plugin built in-house which adds the Ticket scope to the Promotions add-on. It worked fine using older EventEspresso version but we now have to adjust the code to make it work with latest EE version. We are currently getting this error:
Uncaught EE_Error: Hooked in model extension 'EEME_Promotions_Ticket' too late! The model Ticket has already been used! We know because the action AHEE__EEM_Ticket__construct__end has been fired in /public_html/wp-content/plugins/event-espresso-core-reg/core/libraries/plugin_api/db/EEME_Base.lib.php:83
Stack trace:
#0 /public_html/wp-content/plugins/sw-eventespresso-changes/EE4-Promotions-master/db_model_extensions/EEME_Promotions_Ticket.model_ext.php(20): EEME_Base->__construct()
#1 /public_html/wp-content/plugins/event-espresso-core-reg/core/libraries/plugin_api/EE_Register_Model_Extensions.lib.php(109): EEME_Promotions_Ticket->__construct()
#2 /public_html/wp-content/plugins/sw-eventespresso-changes/sw-eventespresso-changes.php(85): EE_Register_Model_Extensions::register('Ticket', Array)
#3 /public_html/wp-inc in /public_html/wp-content/plugins/event-espresso-core-reg/core/libraries/plugin_api/db/EEME_Base.lib.php on line 83
sw-eventespresso-changes is the name of our custom plugin. Here’s how we are registering our scope:
I can see that problem you submitted is discussed in our tEEM and our developers solution is under testing, Once everything is set, we will update you.
I’ve managed to get past the errors and it now seems to be working fine. The issue was that my Ticket scope file EE_Promotion_Ticket_Scope.lib.php was missing some (newer) functions. So I’ve copied and adapted all functions from the original eea-promotions plugin (EE_Promotion_Event_Scope.lib.php) onto my EE_Promotion_Ticket_Scope.lib.php.
Basically, my Ticket scope file is a clone of the Event scope file, with naming and queries adjusted accordingly, if it helps anybody.