onContentAfterSave only triggered in backend (3.5.1)

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
jjqataltcom
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Feb 10, 2016 5:10 pm

onContentAfterSave only triggered in backend (3.5.1)

Post by jjqataltcom » Wed Apr 20, 2016 4:15 pm

I have a content plugin containing onContentAfterSave().

This triggers fine if for example I edit and save an article from the backend.

If I edit and save the same article from the frontend the event doesn't trigger.

I've put a watch/breakpoint on $event in the trigger function in dispatcher.php and for sure oncontentaftersave never shows up.

There's nothing strange about the plugin, it's little more than a placeholder at the moment and like I say it works fine from the backend. I guess I'm doing something dumb...

Anyone else encountered this? (the Joomla event behaviour, not me doing something dumb)

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: onContentAfterSave only triggered in backend (3.5.1)

Post by itoctopus » Thu Apr 21, 2016 10:03 am

If I'm not mistaken, and as far as I remember, and I might be wrong, onContentAfterSave is only triggered when the content is saved for the first time. Again, double check that because it's been some time since we used this event and I'm not 100% sure of this.

Note: I think I'm wrong - but I don't think there is a way for me to delete this post.
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

jjqataltcom
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Feb 10, 2016 5:10 pm

Re: onContentAfterSave only triggered in backend (3.5.1)

Post by jjqataltcom » Thu Apr 21, 2016 10:11 am

Looks like it might be site specific... I just created a new 3.5.1 site with a single article, and the onContentAfterSave event triggers just fine on repeated save from both frontend and backend article editing. The site it's not triggering consistently on is quite old and has gone through multiple upgrades.

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: onContentAfterSave only triggered in backend (3.5.1)

Post by itoctopus » Thu Apr 21, 2016 10:27 am

Try disabling non-core plugins one by one on the non-working website and see if one of the plugins is causing the issue.
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

jjqataltcom
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Feb 10, 2016 5:10 pm

Re: onContentAfterSave only triggered in backend (3.5.1)

Post by jjqataltcom » Thu Apr 21, 2016 4:44 pm

Good suggestion but didn't yield anything... I have a feeling the T3 Framework which is in use on the site might be overriding events somehow but I have to dig through the code a little more.

Update: Not T3 at all. Content & Workflow plugin.

jjqataltcom
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Feb 10, 2016 5:10 pm

Re: onContentAfterSave only triggered in backend (3.5.1)

Post by jjqataltcom » Fri Apr 22, 2016 2:21 pm

Problem solved... or not depending on your point of view... if you have the My Content & Workflow extension installed, all the usual content save events will be bypassed. Which is what you'd expect of course. So nothing faulty at all (far from it) but something to be aware of when developing content plugins.


Locked

Return to “Joomla! 3.x Coding”