Fix: Flashes messages were not displayed for some actions - ref #6814 #6868
+85
−83
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.
Hi!
Issue:
#6814
The flash messages were not displayed on the
course_listpage. It was the case when you deleted a course or when you click on the category button.Problem:
When using
api_location(api_get_self());, the flash messages were somehow cleared.I tried using the PHP
header()function or attempted to manually write the session withsession_write_close(), but nothing worked.The only way to make it work was to remove this line, but doing so prevented the page from redirecting — leaving the parameters visible in the URL, which I’m not very comfortable with (especially the
sec_token).Resolution:
I changed the actions to use a form with the POST method, and now everything works correctly.
I also removed the
'text-warning'class because it didn’t work before, and now that it does apply, it looked a bit odd :Proof:
Capture vidéo du 2025-10-07 11-46-38.webm