• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Introducing new Search Source handler

#1
I'm trying to introduce a new search source handler, I have created a listener for "search_source_setup" but i'm getting this error on search pages

ErrorException: [E_RECOVERABLE_ERROR] Argument 2 passed to **********::searchSource() must be an instance of XF\Search\Source\AbstractSource, null given
Please guide me in the right direction.
 

Mike

XenForo developer
Staff member
#2
Drop the type hint for the source argument. The code incorrectly indicated it should be there. That was just meant to reference the type of object you should be returning.