Skip to content

Commit

Permalink
Fix user messages GetList processor (#16635)
Browse files Browse the repository at this point in the history
### 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
  • Loading branch information
halftrainedharry authored Oct 21, 2024
1 parent e155f60 commit 686bf2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/Revolution/Processors/Security/Message/GetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit 686bf2f

Please sign in to comment.