A partial archive of https://discourse-mediawiki.wmflabs.org as of Saturday May 21, 2022.

How to use the CategoryViewer::doCategoryQuery hook?

y-s-d

I try to change the list of articles which is listed on an category page.
I think the CategoryViewer::doCategoryQuery hook is the right way to do this.
Unfortunately I can’t find any documentation for that hook.
When I try to use it, i cant change the value of $res due to the fact that it is used as value parameter and not as reference.
Am I missing something, that I can do with an ResultWrapper or should the call of the hook in CategoryViewer::doCategoryQuery be with the reference?

RazeSoldier

Maybe CategoryViewer::doCategoryQuery hook is wrong, this hook does not change anything.

y-s-d

Maybe your are right.
But then I wonder what the purpose of that hook is.

And I have still the problem how to modify the list on the category page.
When I change the call of the hook so that the reference of $res is passed to the hook, it works just fine.

RazeSoldier
Tgr

You could subclass CategoryViewer and set the subclass in the CategoryPageView hook.

y-s-d

Thanks for that information! Somehow I was not able to find that.

I will try that. Thanks!

Nean

.a what, это a hook then m?