Problem/Motivation
If a request contains an invalid consumer ID (in the header or query parameter), a PHP fatal error is thrown:
Call to a member function uuid() on null in Drupal\consumers\Negotiator->negotiateFromRequest()
Steps to reproduce
Make a request without a consumer in the request and verify that everything is working as expected. Add ?consumerId=foo to the request URL and see that there is a fatal error. Now replace "foo" with the actual UUID of a consumer and verify that everything is fine again.
Proposed resolution
Fall back to the default consumer if an invalid one is passed. Since there is the concept of falling back to the default anyway (if none is passed explicitly) this seems to be in-line with the current semantics. Alternatively, a proper exception could be thrown, but that would be a change in documented behavior (not in actual behavior, because right now there is a fatal already).
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork consumers-3267346
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tstoecklerComment #4
tstoecklerAdding the error message to the issue summary for searchability.
Comment #5
e0ipsoI missed you my friend!
This looks like a good improvement, and straight forward enough.
Comment #7
e0ipsoComment #8
tstoeckler❤️ yes, you as well! ☺️
Thanks for the super quick turnaround. Much appreciated, as well!