I found the cause of the special treatment of 'search' parameters in the url.
In the MediaWiki::parseTitle() function there is this piece of code:
if ( $request->getCheck( 'search' ) ) {
// Compatibility with old search URLs which didn't use
Special:Search
// Just check for presence here, so blank requests still
// show the search page when using ugly URLs (bug 8054).
$ret = SpecialPage::getTitleFor( 'Search' );
}
No hooks anywhere there to influence this, so it seems that the only way to use
another search page is to change the MediaWiki class :-).
Or am I missing some other option?
> On 23 Jul 2016, at 13:58, Ad Strack van Schijndel
> <[email protected]> wrote:
>
> I have done what you said and it made a difference, but did not yield the
> desired result.
>
> The search parameter in the url is still the boss and that makes it redirect
> to Special:Search in stead of the new one.
>
> By the way I changed not only 'searchtitle' but also 'searchaction', which
> can be seen in the template, but as I said still the Special:Search comes up.
>
>
>> On 22 Jul 2016, at 11:21, Vedmaka <[email protected]
>> <mailto:[email protected]>> wrote:
>>
>> I guess you should modify your skin template date either directly or via
>> hook to override 'searchtitle' data item. By default
>> $template->get('searchtitle') returns name of Special:Search page [1]. You
>> should change it to yours.
>>
>> 1. see /includes/skins/SkinTemplate.php:312
>>
>> 22.07.2016 12:16, Guillaume Lederrey пишет:
>>> That's probably a question that Discovery could answer. Forwarding to
>>> that list...
>>>
>>> On Fri, Jul 22, 2016 at 11:01 AM, Ad Strack van Schijndel
>>> <[email protected] <mailto:[email protected]>>
>>> wrote:
>>>> A configuration setting would be nice, but I couldn't find one. Same with
>>>> hooks.
>>>>
>>>> So any way would do I suppose.
>>>>
>>>> We created an extension with a new search page by making a subclass of
>>>> SpecialSearch and changing some functions and adding some hooks. That
>>>> seems like a good idea but when searching there is always a redirect to
>>>> Special:Search and I can't figure out how to change that.
>>>>
>>>>
>>>>> On 21 Jul 2016, at 16:29, John <[email protected]
>>>>> <mailto:[email protected]>> wrote:
>>>>>
>>>>> like what?
>>>>>
>>>>> On Thu, Jul 21, 2016 at 10:27 AM, Ad Strack van Schijndel <
>>>>> [email protected] <mailto:[email protected]>>
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> It seems that a search always leads to Special:Search, no matter what.
>>>>>> That has to do with the search parameter in the url.
>>>>>> Is there an elegant way to make a search request go to another search
>>>>>> page?
>>>>>>
>>>>>> Thanks!
>>>>>> Ad
>>>>>> _______________________________________________
>>>>>> MediaWiki-l mailing list
>>>>>> To unsubscribe, go to:
>>>>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>>>> <https://lists.wikimedia.org/mailman/listinfo/mediawiki-l>
>>>>>>
>>>>> _______________________________________________
>>>>> MediaWiki-l mailing list
>>>>> To unsubscribe, go to:
>>>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>>> <https://lists.wikimedia.org/mailman/listinfo/mediawiki-l>
>>>>
>>>>
>>>> _______________________________________________
>>>> MediaWiki-l mailing list
>>>> To unsubscribe, go to:
>>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>> <https://lists.wikimedia.org/mailman/listinfo/mediawiki-l>
>>>
>>>
>>>
>>
>>
>> --
>>
>> _____________________________________________________________
>> Mediawiki & Semantic Mediawiki support: https://mediawiki.pro
>> <https://mediawiki.pro/>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> To unsubscribe, go to:
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>> <https://lists.wikimedia.org/mailman/listinfo/mediawiki-l>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l