From 686bf2f3ee85cda07fcf19bfa662a85ccd23c510 Mon Sep 17 00:00:00 2001 From: halftrainedharry <85392304+halftrainedharry@users.noreply.github.com> Date: Mon, 21 Oct 2024 21:25:05 +0200 Subject: [PATCH] Fix user messages GetList processor (#16635) ### What does it do? Fixes the join condition in the processor query. ### Why is it needed? The result is incorrect, if in the user profile the `id` is different from the `internalKey`. ### How to test Make sure that on your installation, the (auto-increment) ID column of the `modUserProfile` is out-of-sync with the `modUser` ID. Test that all messages are visible and the values of `username` and `fullname` (in the columns "Sender" and "Recipient") correspond to each other. ### Related issue(s)/PR(s) Resolves #16634 for MODX 3.x --- core/src/Revolution/Processors/Security/Message/GetList.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/Revolution/Processors/Security/Message/GetList.php b/core/src/Revolution/Processors/Security/Message/GetList.php index 4746f3e842e..e35c59f9bb9 100644 --- a/core/src/Revolution/Processors/Security/Message/GetList.php +++ b/core/src/Revolution/Processors/Security/Message/GetList.php @@ -40,8 +40,8 @@ public function prepareQueryBeforeCount(xPDOQuery $c) { $c->innerJoin(modUser::class, 'Sender'); $c->innerJoin(modUser::class, 'Recipient'); - $c->innerJoin(modUserProfile::class, 'SenderProfile', 'SenderProfile.id = modUserMessage.sender'); - $c->innerJoin(modUserProfile::class, 'RecipientProfile', 'RecipientProfile.id = modUserMessage.recipient'); + $c->innerJoin(modUserProfile::class, 'SenderProfile', 'SenderProfile.internalKey = modUserMessage.sender'); + $c->innerJoin(modUserProfile::class, 'RecipientProfile', 'RecipientProfile.internalKey = modUserMessage.recipient'); switch ($this->getProperty('type')) { case 'outbox':