Problem/Motivation
We introduced extra hardening in the VariationCache but for BC reasons could not throw an exception. We ended up going for a trigger_error with level E_USER_WARNING instead, but writing the tests in a way already that they expect a LogicException. This was achieved by having the tests user a custom error handler. See #3452181: VariationCache needs to be more defensive about cache context manipulation to avoid broken redirects
The goal is to remove this trigger_error in favor of an actual LogicException and to remove the small workaround from the tests.
Steps to reproduce
N/A
Proposed resolution
- Convert trigger_error in VariationCache into LogicException
- Remove custom error handler and try-catch in VariationCacheTest
Remaining tasks
Wait for D12 branch to become available
User interface changes
N/A
Introduced terminology
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
TBD
Issue fork drupal-3468921
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 #2
naveenvalechaComment #3
kristiaanvandeneyndeComment #5
smustgrave commentedFYI this one is ready to be worked on
Comment #6
smustgrave commentedComment #7
smustgrave commentedMay be a stretch for Florida camp but lets see if anyone there has interest :)
Comment #9
smustgrave commentedTook a shot at it
Comment #10
dcam commentedI have limited experience setting custom error handlers, but it looks like we have a few more statements that can be deleted here.
Comment #11
smustgrave commentedPushed some feedback.
Comment #12
dcam commentedI don't have any additional feedback. This looks good.
Comment #16
godotislateCommitted c7dc148 and pushed to main. Thanks!