Issue #3585521: NotificationRequiredCondition should filter purge_users_notifications on type = 'notification_users'
Closes #3585521.
Summary
NotificationRequiredCondition (labeled Users pre-notified only) was doing an INNER JOIN on purge_users_notifications without filtering on the type column, so any row satisfied the condition — including type = 'purge_users' rows written by UserManagementService::notifyUserToPurge() at deletion time. A 'purge_users' row is not a pre-notification, so it must not make a user purgeable under this condition.
Change
-
src/Plugin/Condition/NotificationRequiredCondition.php: addAND pun.type = :type(with'notification_users') to the inner join predicate.
Tests
tests/src/Kernel/policy/NotificationRequiredTypeFilterTest.php exercises the four row combinations plus a recency edge case:
-
'notification_users'row older than the delay → purgeable. - Only
'purge_users'row → NOT purgeable. - Both rows present (older than delay) → purgeable.
- Recent
'notification_users'row (younger than delay) → NOT purgeable. - No rows → NOT purgeable.
All 5 pass; full kernel suite (109 tests) green.