Fix institution mismatch after saving vetting-type-hint - #532
Open
kayjoosten wants to merge 2 commits into
Open
kayjoosten wants to merge 2 commits into
kayjoosten wants to merge 2 commits into
Conversation
Redirect to the vetting-type-hint route with the saved institution on success, instead of re-rendering directly. Previously the select institution dropdown and page subtitle fell back to the RAA's home institution on POST, while the hint text shown was for the institution that was actually just edited, leaving the two out of sync. On save failure the form still re-renders in place so the submitted hints are not lost. Fixes #409
kayjoosten
commented
Sep 7, 2026
johanib
reviewed
Sep 16, 2026
| $this->logger->debug('Vetting type hint saving failed, adding error to form'); | ||
| $this->addFlash('error', 'ra.vetting_type_hint.error'); | ||
|
|
||
| return $this->redirectToRoute('vetting_type_hint', ['institution' => $institution]); |
Contributor
There was a problem hiding this comment.
This does not seem to fix the issue. It seems, when you choose an institution, the URL does not change, which this fix relies on.
Also, can we add integration tests, like panther? So we can properly test this, instead of using the controller test that sets up a very specific scenario to test, which does not represent the real situation.
johanib
requested changes
Sep 16, 2026
The previous version of this fix redirected using $institution, which is only ever set from the URL's institution query param. Selecting a non-home institution via the select-institution form never changes the URL though (it re-renders in place), so any save made after switching institutions redirected back to the RAA's home institution again, reintroducing the original bug. Use $command->institution (bound from the hint form's hidden field, which does correctly carry the just-selected institution forward across requests) for the redirect, but only when it is one of the institutions this identity is actually authorized for. This keeps the dropdown/subtitle in sync with the institution that was really saved, while still refusing to trust a tampered hidden field. Adds a WebTestCase-based functional test that exercises the real, multi-request flow (select a non-home institution, then save) end to end, since the existing controller test only covered a single- institution scenario and could not catch this regression. This needed symfony/browser-kit and symfony/css-selector as new dev dependencies, and a fix to ci/qa/phpunit: it never exported APP_ENV as a real environment variable, so config/bootstrap.php always fell back to the "prod" environment for phpunit, and kernel-booting tests failed with framework.test not being enabled.
kayjoosten
force-pushed
the
feature/issue-409-vetting-type-hint-institution
branch
from
September 16, 2026 11:56
4e656f9 to
b70f473
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #409
Test plan
COMPOSER_MEMORY_LIMIT=1G composer check-cipasses.