Skip to content

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Sep 25, 2025

This updates the NDB_Form class to respond with a 303 See Other after a successful page and redirect to the same page.

This (in addition to being a better practice) fixes problems where the page is rendered before changes that depend on the updated values are saved to the database.

In particular, when changing the language on the my_preferences page, it will now immediately take effect rather than only doing after after the next page load.

Blocked by #10031

@github-actions github-actions bot added Language: PHP PR or issue that update PHP code Module: statistics PR or issue related to statistics module Module: api PR or issue related to api module Module: candidate_profile PR or issue related to candidate_profile module Module: conflict_resolver PR or issue related to conflict_resolver module Module: instruments PR or issue related to instruments module labels Sep 25, 2025
@driusan driusan added the State: Blocked PR or issue awaiting an external event such as the merge or another PR to proceed label Sep 25, 2025
@CamilleBeau CamilleBeau self-assigned this Sep 29, 2025
@CamilleBeau
Copy link
Collaborator

@driusan the PR needs an update for test suite

Dave MacFarlane added 2 commits September 30, 2025 12:51
The BaseRouter/Prefix router stripped off the handled part of the URI
before passing it to other handlers. The reasoning was that then the
modules could treat the request without regard to the location that LORIS
is being served for and act as if it's always the root.

However, in practice this causes more problems than it solves. The original
URI is lost completely, so middleware, error pages, and http headers that may
need it do not have access to it without reconstructing it.

This updates the handled part of the URI to go into an "unhandledURI" attribute
while leaving the request->getURI untouched. Doing so allows us to access
the original URI when needed and if ie. you print $request->getURI() in an
error message you will get the correct value.
@driusan driusan force-pushed the MyPreferencesSaveFix branch from 18b4024 to 62d5d49 Compare September 30, 2025 16:51
@driusan
Copy link
Collaborator Author

driusan commented Sep 30, 2025

@CamilleBeau rebased

@CamilleBeau CamilleBeau removed their assignment Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language: PHP PR or issue that update PHP code Module: api PR or issue related to api module Module: candidate_profile PR or issue related to candidate_profile module Module: conflict_resolver PR or issue related to conflict_resolver module Module: instruments PR or issue related to instruments module Module: statistics PR or issue related to statistics module State: Blocked PR or issue awaiting an external event such as the merge or another PR to proceed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants