- Status changed to Needs work
10 months ago 10:45pm 18 January 2024 - 🇺🇸United States SocialNicheGuru
I get this error once I put this patch in:
Drupal\consumers\EventSubscriber\ConsumerVaryEventSubscriber::onRespond(): Argument #1 ($event) must be of type Symfony\Component\HttpKernel\Event\FilterResponseEvent, Symfony\Component\HttpKernel\Event\ResponseEvent given in Drupal\consumers\EventSubscriber\ConsumerVaryEventSubscriber->onRespond() (line 26 of modules/contrib/consumers/src/EventSubscriber/ConsumerVaryEventSubscriber.php).
- Status changed to Needs review
10 months ago 2:19pm 25 January 2024 - 🇺🇦Ukraine sickness29
Hi @SocialNicheGuru
you need to update your drupal instance to 9.5 at least to avoid this problem.
This FilterResponseEvent class is deprecated and has been replaced by ResponseEvent.
Patch itself is no reason for your issue.
https://www.drupal.org/project/drupal/issues/3130651 →Also I have tidied up the patch to remove php cs warnings.
- 🇺🇸United States eojthebrave Minneapolis, MN
Thanks for continuing to work on this. It would be helpful for me if someone could give me a quick set of instructions for testing this patch. And, should we include tests for this in the code? It looks like there was an attempt at writing tests in #2 but there are no tests in the latest patch.
- 🇺🇦Ukraine sickness29
Hi @eojthebrave
here I reworked test from #2 to work with D9+ and used a bit another approach with computed field.
I am posting only test here to make sure it fails and going to post another comment with test and fix - last update
9 months ago 2 pass, 3 fail - 🇺🇦Ukraine sickness29
Fix to the machine name call to make it D9 and D10 compatible
- last update
9 months ago 2 pass, 2 fail - last update
9 months ago 3 pass, 1 fail - last update
9 months ago 3 pass - Status changed to Needs work
8 months ago 12:34pm 15 March 2024 - 🇺🇸United States eojthebrave Minneapolis, MN
Thanks for working on this. I've finally been able to take a look at the code and do a little testing.
When testing this out locally it looks like the code in
\Drupal\consumers\ConsumerRouteEnhancer
assumes that JSON:API is enabled. Without it enabled I get this error when trying to view a nodeError: Class "Drupal\jsonapi\Routing\Routes" not found in Drupal\consumers\ConsumerRouteEnhancer->enhance() (line 50 of modules/contrib/consumers/src/ConsumerRouteEnhancer.php).
Additionally, in that class, this constant is set but never used
\Drupal\consumers\ConsumerRouteEnhancer::CONSUMER_QUERY_PARAMETER
so could probably be removed?And maybe I'm just not clear on how this works, but if we're going to set a
Vary: X-Consumer-ID
header, should we also set anX-Consumer-ID
header so that it knows what value to vary on? - Status changed to Needs review
8 months ago 10:24am 20 March 2024 - 🇺🇦Ukraine sickness29
Hi @eojthebrave,
thanks for the feedback, I have prepared updated patch with fixes - last update
8 months ago 3 pass - last update
8 months ago 3 pass - 🇮🇳India rakesh.regar Rajasthan, India
rakesh.regar → made their first commit to this issue’s fork.
- Merge request !11Issue #3001043 Cacheability issue when using _consumer_id query in JsonApi responses → (Open) created by rakesh.regar
- 🇮🇳India rakesh.regar Rajasthan, India
Raised Merge Request with the #15 patch.
-
eojthebrave →
committed 5af35352 on 8.x-1.x
Issue #3001043 by sickness29, stBorchert, ibustos, alex.skrypnyk,...
-
eojthebrave →
committed 5af35352 on 8.x-1.x
- Status changed to Fixed
7 months ago 4:13pm 24 April 2024 - 🇺🇸United States eojthebrave Minneapolis, MN
Thanks for making the updates @sickness29. I've just committed the patch from #15. So I think we can call this fixed now.
Thanks for everyone who has help work on this.
Automatically closed - issue fixed for 2 weeks with no activity.