PdoAddressBook ORDER BY deleted DESC to prevent sync and export issues

This commit is contained in:
the-djmaze 2023-02-09 13:50:09 +01:00
parent 08d4cf3648
commit 2b7962805f

View file

@ -107,9 +107,12 @@ class PdoAddressBook
private function prepareDatabaseSyncData() : array
{
$aResult = array();
$oStmt = $this->prepareAndExecute('SELECT id_contact, id_contact_str, changed, deleted, etag FROM rainloop_ab_contacts WHERE id_user = :id_user', array(
':id_user' => array($this->iUserID, \PDO::PARAM_INT)
));
$oStmt = $this->prepareAndExecute('SELECT id_contact, id_contact_str, changed, deleted, etag
FROM rainloop_ab_contacts
WHERE id_user = :id_user
ORDER BY deleted DESC',
array(':id_user' => array($this->iUserID, \PDO::PARAM_INT))
);
if ($oStmt) {
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);