SimpleMachines / SMF

Simple Machines Forum — SMF in short — is free and open-source community forum software, delivering professional grade features in a package that allows you to set up your own online community within minutes!
https://www.simplemachines.org/
Other
583 stars 250 forks source link

Database error when attempting to export PMs? #6805

Closed Oldiesmann closed 3 years ago

Oldiesmann commented 3 years ago

Description

This error popped up in the error log of the seniors forum I host/run (RC3). I was unable to reproduce it on my test board running the latest GitHub build so it's possible this has been fixed already.

Steps to reproduce

  1. Go to your profile and select the option to export data including PMs
  2. You will get this error in your error log

Environment (complete as necessary)

Additional information/references

Database Error: '{db}.pm2.from_name' isn't in GROUP BY

        SELECT pm.id_pm, pm.msgtime, pm.subject, pm.body, pm.id_member_from, nis.from_name, nis.id_members_to, nis.to_names
        FROM smf_personal_messages AS pm
        INNER JOIN
        (
            SELECT pm2.id_pm, COALESCE(memf.real_name, pm2.from_name) AS from_name, GROUP_CONCAT(pmr.id_member) AS id_members_to, GROUP_CONCAT(COALESCE(mem.real_name, mem.member_name)) AS to_names
            FROM smf_personal_messages AS pm2
                INNER JOIN smf_pm_recipients AS pmr ON (pm2.id_pm = pmr.id_pm)
                INNER JOIN smf_members AS mem ON (mem.id_member = pmr.id_member)
                LEFT JOIN smf_members AS memf ON (memf.id_member = pm2.id_member_from)
            WHERE pm2.id_pm > 0
                AND (
                    (pm2.id_member_from = 1154 AND pm2.deleted_by_sender = 0)
                    OR (pmr.id_member = 1154 AND pmr.deleted = 0)
                )
            GROUP BY pm2.id_pm, memf.real_name
            ORDER BY pm2.id_pm ASC
            LIMIT 250
        ) AS nis ON nis.id_pm = pm.id_pm
        ORDER BY pm.id_pm ASC

File: /.../Sources/News.php
Line: 2593
Sesquipedalian commented 3 years ago

Duplicate of #6309