Skip to content

Clean up FlashMessenger calls.#5058

Merged
demiankatz merged 4 commits intovufind-org:devfrom
EreMaijala:dev-flashmessenger-cleanup
Feb 6, 2026
Merged

Clean up FlashMessenger calls.#5058
demiankatz merged 4 commits intovufind-org:devfrom
EreMaijala:dev-flashmessenger-cleanup

Conversation

@EreMaijala
Copy link
Contributor

Unifies the way flash messages are added.

@EreMaijala EreMaijala requested a review from demiankatz February 5, 2026 16:27
// Set flash message if requested:
if (null !== $flashNamespace && !empty($flashMsg)) {
$this->flashMessenger()->addMessage($flashMsg, $flashNamespace);
match ($flashNamespace) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is perhaps a bit idealistic, but I didn't like the way the FlashMessenger namespaces were involved here. But I can revert this part if necessary.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we at least cover the known valid namespaces (i.e. add 'Info')? Do we need a default case that throws an exception for unexpected non-null values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add them. They're not used by default, and there's nothing preventing one from adding flash messages by other means, but I guess someone could be using this locally with other options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added. Note that I left default out intentionally. I'll propose that we don't support it in the upcoming rewrite, because in the Laminas implementation it's kind of a confusing mix of actual namespace and something set as default.

@EreMaijala
Copy link
Contributor Author

Mink tests are still passing for me.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, apart from the comment above regarding the match statement.

@demiankatz demiankatz added this to the 11.1 milestone Feb 5, 2026
@EreMaijala EreMaijala requested a review from demiankatz February 6, 2026 08:02
Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now; thanks, @EreMaijala!

@demiankatz demiankatz merged commit f7df11f into vufind-org:dev Feb 6, 2026
6 checks passed
@demiankatz demiankatz deleted the dev-flashmessenger-cleanup branch February 6, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments