diff --git a/.vscode/settings.json b/.vscode/settings.json index 74ae131a..db58cfbc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,10 @@ { "php-cs-fixer.executablePath": "/workspaces/nextcloud-gdata-antivirus/vendor/bin/php-cs-fixer", - "php-cs-fixer.onsave": true, + "php-cs-fixer.onsave": false, "php-cs-fixer.autoFixByBracket": true, "php-cs-fixer.autoFixBySemicolon": true, "[php]": { "editor.defaultFormatter": "junstyle.php-cs-fixer" }, + "php.suggest.basic": false } \ No newline at end of file diff --git a/lib/Db/DbFileMapper.php b/lib/Db/DbFileMapper.php index edac9a61..066375b7 100644 --- a/lib/Db/DbFileMapper.php +++ b/lib/Db/DbFileMapper.php @@ -29,7 +29,7 @@ public function getFileIdsWithoutTags(array $excludedTagIds, int $limit, int $of $qb->select('f.fileid') ->from($this->getTableName(), 'f') - ->leftJoin('f', 'systemtag_object_mapping', 'o', $qb->expr()->eq('o.objectid', $qb->createFunction(sprintf('CAST(f.fileid AS %s)', $this->stringType)))) + ->leftJoin('f', 'systemtag_object_mapping', 'o', $qb->expr()->eq($qb->createFunction('CAST(o.objectid as unsigned)') , 'f.fileid')) ->leftJoin('f', 'mimetypes', 'm', $qb->expr()->eq('f.mimetype', 'm.id')) ->where($qb->expr()->notIn('o.systemtagid', $qb->createNamedParameter($excludedTagIds, IQueryBuilder::PARAM_INT_ARRAY))) ->orWhere($qb->expr()->isNull('o.systemtagid')) @@ -68,7 +68,7 @@ public function getFileIdsWithTags(array $includedTagIds, int $limit, int $offse $qb->select('f.fileid') ->from($this->getTableName(), 'f') - ->leftJoin('f', 'systemtag_object_mapping', 'o', $qb->expr()->eq('o.objectid', $qb->createFunction(sprintf('CAST(f.fileid AS %s)', $this->stringType)))) + ->leftJoin('f', 'systemtag_object_mapping', 'o', $qb->expr()->eq($qb->createFunction('CAST(o.objectid as unsigned)') , 'f.fileid')) ->leftJoin('f', 'mimetypes', 'm', $qb->expr()->eq('f.mimetype', 'm.id')) ->where($qb->expr()->in('o.systemtagid', $qb->createNamedParameter($includedTagIds, IQueryBuilder::PARAM_INT_ARRAY))) ->andWhere($qb->expr()->notLike('m.mimetype', $qb->createNamedParameter('%unix-directory%')))