Problem/Motivation
Entity Activity Mail on 2.x-dev has two queue-worker regressions that are reproducible on Drupal 11.4.4:
PrepareReportWorker::processItem()returns from the entire batch when it encounters a user who is already being processed. Any eligible users later in the same batch are skipped and their reports are not queued.ReportWorker::processItem()passesTranslatableMarkupobjects to PSR-3 logger methods. Drupal 11'sDrupalConsoleLoggerexpects a string message, so both successful and failed report delivery paths can end withTypeError: strtr(): Argument #1 ($string) must be of type string, TranslatableMarkup given.
These failures were found while testing Entity Activity 2.x-dev at commit 3484e273d87dcfd86fbc27d019ebd9181f500835 with PHP 8.3.
Steps to reproduce
- Enable Entity Activity Mail and configure reports to be logged.
- Create unsent activity logs for two eligible users.
- Mark the first user as already being processed, then invoke the prepare-report queue worker with both user IDs in that order.
- Observe that no report is queued for the second user because the worker returns instead of continuing the loop.
- Invoke the report worker for a valid recipient on Drupal 11, using either a successful or failed mail result.
- Observe the logger
TypeErrorwhen the worker passes translated markup as the log message.
Proposed resolution
- Continue to the next recipient when a user is already being processed.
- Pass untranslated string message templates and placeholder context arrays to the logger, following Drupal logging practices.
- Add regression coverage for a mixed processing/eligible recipient batch and for successful and failed report delivery.
Remaining tasks
- [x] Create a merge request against
2.xwith the fixes and automated regression tests. - [x] Confirm the GitLab CI pipeline passes.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork entity_activity-3623904
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
ivrh commentedComment #5
ivrh commentedMR !15 merged into 2.x at
294ce4c0c17637a411214586a12679edbd485e91after merge-train pipeline #964916 passed.No work remains. Marking Fixed; version remains 2.x-dev.