Closed (fixed)
Project:
Facets
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 May 2018 at 08:36 UTC
Updated:
30 Mar 2022 at 09:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joshi.rohit100Comment #3
piyuesh23 commentedAdding support to add query parameters directly as well (non f[*] query params).
Comment #4
miteshmapComment #5
borisson_We should add test-coverage for this as well. Probably by introducing a new testmodule. The idea is good though.
Comment #6
legolasboI slightly adjusted the approach to use events instead of hooks, since that's the direction search api and core are moving in. I've also added a test to cover this use case.
Let's see what testbot thinks about it.
Comment #7
joshi.rohit100Empty patch :)
Comment #8
legolasboComment #9
joshi.rohit100Event class name doesn't look correct as here we not creating/building the querystring but this is to modify/change.
similarly event name not looks correct.
this also not looks correct (naming)
Idea behind the patch looks fine to me but its just the naming things not looking correct (which again one of the difficult thing in programming) :)
Comment #10
borisson_This is looking super super solid already. I am super grateful that you took on this issue @legolasbo. I would've just implemented the suggested hook instead of using this as an event. Thank you for making sure we use modern best practices.
I mentioned to change private to protected a few times in the review here. I think the general consensus is to not make things protected because that way other can easily overwrite this.
On the other hand - this is an Event, not a normal class. Would someone even be overwriting/extending that? I think we could also ignore that and keep them as private and instead make the class final. That'd also work for me.
That might even be better.
I actually like this event name, in contrast to #9. How I understand the naming convention we should use for events it should be the name of what just happened, not what action is possible to do when it is thrown.
So +1 from me.
/s/private/protected/
/s/private/protected/
/s/private/protected/
/s/private/protected/ Also needs a newline after it.
/s/private/protected/
Not sure what the indentation rules are when splitting a constructor over multiple lines. But this looks odd. It could be that this is correct though. In that case please ignore me.
I think the readability doesn't suffer too much when this is on one line.
I agree with @joshi.rohit100 that this looks really weird because of the double get. Is
getQueryParametersbetter? (we'd have to change the underlying property as well).Needs an
{@inheritdoc}Comment #11
borisson_Didn't mean to change status. :/
Comment #12
legolasboThis should do it :)
Comment #13
borisson_I forgot about this issue and just wanted to commit it, but it no longer applies.
Comment #14
visabhishek commentedJust rerolled the patch 2970987-12.patch
Comment #15
borisson_Committed and pushed, thanks!
Comment #18
p-neyens commentedAt the moment it is not possible to alter the filterParams through the eventSubscriber.
It's only possible to add extra params to the result_get_params because it is an object.
If you want to remove some filterParam it will be overridden by the following line.
$result_get_params->set($this->filterKey, array_values($filter_params));
Comment #19
anybody#18 was fixed in a followup isse FYI: #3182988: The QueryStringCreated event dispatcher does not work