on_page_version_approve fired when switching to edit mode for a new page type

Permalink
Hello everyone,

I am currently working on a way to automatically publish content to some social network. I therefore want to have it pushed to the social network when a version of the content is approved/"definitely" published. So I added an EventListener to on_page_version_approve.

Thing is, this event fires event when I'm creating the page from the dialog and hit "Edit mode". I would have expected the event to be fired only when we hit "the blue button".

I already tried to disable the cache in the controller I made, as well as putting the EventListener in the applicaton/config/app.php file, without luck — even after clearing the cache manually.

Could someone spot what I'm missing ?

Thanks in advance

diabolodesign
 
diabolodesign replied on at Permalink Reply
diabolodesign
Is there anyone who tried successfully to subscribe to such event and have their code not to be triggered when switching from dialog to edit mode, please ?
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi diabolodesign,

Since no one has offered a solution to this question, you might consider Stack Overflow.
https://www.concrete5.org/developers/stack-overflow...