Skip to content

fix(imp): prevent search and subscribe PHP warnings#84

Merged
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/search-mbox-subscribe-php-warnings
Jul 1, 2026
Merged

fix(imp): prevent search and subscribe PHP warnings#84
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/search-mbox-subscribe-php-warnings

Conversation

@TDannhauer

Copy link
Copy Markdown
Contributor

Summary

  • Normalize IMP_Search_Query mailbox lists to IMP_Mailbox objects before deduplication
  • Ensure IMP_Mailbox::subscribe() always sets a success notification when the parent mailbox action succeeded

Motivation

array_unique(..., SORT_REGULAR) could keep mailbox path strings instead of IMP_Mailbox objects when the same mailbox appeared as both, causing Attempt to read property "container" on string in search query building. With subfolders: true, ignored subfolder subscribe errors left $notify undefined even though the parent mailbox subscribe/unsubscribe had already succeeded.

Changes

  • Build the cached mboxes list by normalizing through IMP_Mailbox::get() and deduplicating by mailbox name
  • Fall back to the single-mailbox success message when no subfolder action succeeded

Test plan

  • Run a mailbox search spanning folders with subfolder expansion
  • Subscribe/unsubscribe a mailbox with the subfolders option when some subfolders fail on the server

Normalize IMP_Search_Query mailbox lists to IMP_Mailbox objects before
deduplicating, avoiding array_unique() keeping string entries. Ensure
subscribe() always sets a success notification when the parent mailbox
action succeeded but all subfolder attempts were ignored.
@TDannhauer TDannhauer requested a review from ralflang July 1, 2026 10:02
@ralflang ralflang merged commit c2378fd into FRAMEWORK_6_0 Jul 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants