Fix sqlite bug, hope the mysql problem is not happening on other systems and the sql statement works on all the other systems

This commit is contained in:
Marcos Zuriaga 2016-10-14 23:37:16 +02:00
parent c91c9cb6d8
commit 0779d79cca
No known key found for this signature in database
GPG key ID: 7D15585354D072FF

View file

@ -43,7 +43,9 @@ class ShareRequestMapper extends Mapper {
* @return ShareRequest[]
*/
public function getRequestsByItemGuidGroupedByUser($item_guid){
$this->db->executeQuery("SET sql_mode = '';");
if (strtolower($this->db->getDatabasePlatform()->getName()) === 'mysql'){
$this->db->executeQuery("SET sql_mode = '';");
}
$q = "SELECT *, target_user_id FROM *PREFIX*" . self::TABLE_NAME . " WHERE item_guid = ? GROUP BY target_user_id;";
return $this->findEntities($q, [$item_guid]);
}