Finder Events How does it work?

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
frogydiak
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Tue Sep 10, 2013 11:37 pm

Finder Events How does it work?

Post by frogydiak » Wed Sep 07, 2016 5:30 pm

Any expert on Joomla Finder please help.

I don't understand how the events in finder plugin like: onFinderChangeState() being triggered. I tried to look for it in Content and it seems to be not called anywhere. How is this being triggered? My logic says that when an item change state, this event is triggered and would also change the state of the finder index but if I look for that particular item in finder index, the item has not change state. But if I search for that item, it does what it supposed to do.

- So how does this events work then?
- Where does this event being triggered in the component?

Thanks!

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Finder Events How does it work?

Post by sovainfo » Wed Sep 07, 2016 6:15 pm

Those events are triggered by the content plugin called finder. Obviously when things change in content the appropriate finder event is triggered.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

frogydiak
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Tue Sep 10, 2013 11:37 pm

Re: Finder Events How does it work?

Post by frogydiak » Sun Sep 11, 2016 2:23 am

Hi Sova,

Thanks for your reply.

I know that there should be a finder plugin but what I don't understand is:

- where in the component code that a method in the finder plugin like onFinderChangeState() is being triggered or called?

or

- what and where are the methods in the finder plugin being triggered? Is it automatic?

Knowing where that should in my component code (model or controller) I would be able to make my component item publish and unpublish depending on the set state. But now, if just follow how the content (articles) finder plugin nothing is happening if I change the item state.

Thanks!

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Finder Events How does it work?

Post by sovainfo » Sun Sep 11, 2016 2:46 am

Sounds like you don't really understand the plugin mechanism. The finder plugin is a type content plugin. That means it implements the events triggered by content components. It is the content events that trigger the finder events. Obviously, the finder events are not called directly by the components. The content event onContentChangeState triggers onFinderChangeState.

Sounds like you are missing the on<yourcomponent>ChangeState, both the triggering and the finder plugin typed <yourcomponent>. When you consider your component the same as content, you need to trigger the onContent events at the appropriate places in your component.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!


Locked

Return to “Joomla! 3.x Coding”