Skip to content

fix(imp): return IMP_Mailbox objects from Vtrash mboxes#90

Merged
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/vtrash-mboxes-objects
Jul 10, 2026
Merged

fix(imp): return IMP_Mailbox objects from Vtrash mboxes#90
ralflang merged 1 commit into
FRAMEWORK_6_0from
fix/vtrash-mboxes-objects

Conversation

@TDannhauer

Copy link
Copy Markdown
Contributor

Summary

  • Fix IMP_Search_Vfolder_Vtrash::mboxes to return IMP_Mailbox objects instead of raw strings.

Motivation

Virtual Trash is queried/polled frequently, producing repeated PHP 8 warnings:
Attempt to read property "container" on string at lib/Search/Query.php:270.
The base IMP_Search_Query getters (query, querytext) expect IMP_Mailbox
objects, and IMP_Search_Vfolder_Vinbox already returns them.

Changes

  • Wrap the iterator result in IMP_Mailbox::get(...) in Vtrash::__get('mboxes').

Test plan

  • Open/poll Virtual Trash; confirm the warning no longer appears in the Horde log.
  • Expunge from Virtual Trash still works (relies on IMP_Mailbox objects in the process list).

IMP_Search_Vfolder_Vtrash::__get('mboxes') returned raw mailbox name
strings, but IMP_Search_Query consumers expect IMP_Mailbox objects
(e.g. the 'query' getter reads $mbox->container and 'querytext' reads
$val->display). Under PHP 8 this triggered repeated warnings:

  Attempt to read property "container" on string
  (lib/Search/Query.php line 270)

Wrap the result in IMP_Mailbox::get(), matching
IMP_Search_Vfolder_Vinbox and the base-class contract. This also fixes
a latent bug in IMP_Mailbox::expunge(), whose process list is
documented to contain IMP_Mailbox objects.
@TDannhauer TDannhauer requested a review from ralflang July 8, 2026 19:47
@ralflang ralflang merged commit d34cd68 into FRAMEWORK_6_0 Jul 10, 2026
1 check failed
@TDannhauer TDannhauer deleted the fix/vtrash-mboxes-objects branch July 10, 2026 06:33
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