Some fixes - #2310
Merged
Merged
Conversation
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances type safety for database queries by importing IQueryBuilder and specifying IQueryBuilder::PARAM_INT for positional and named parameters across migrations and mappers. It also improves error handling in TreeMapper::getSubFolders by catching loading exceptions and filtering out failed shares.
- Imported
IQueryBuilderand addedPARAM_INTto allcreatePositionalParameter/createNamedParametercalls - Added try/catch around shared-folder loading in
TreeMapperand filtered outnullentries
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/Migration/Version003000000Date20191123094721.php | Added IQueryBuilder import and PARAM_INT for positional parameters in postSchemaChange |
| lib/Migration/Version000014000Date20181029094721.php | Added IQueryBuilder import and PARAM_INT in postSchemaChange |
| lib/Migration/OrphanedSharesRepairStep.php | Added IQueryBuilder import and PARAM_INT for delete queries |
| lib/Db/TreeMapper.php | Specified PARAM_INT in move, added exception handling and filtered null in getSubFolders |
| lib/Db/TagMapper.php | Added IQueryBuilder import and PARAM_INT for tag lookups |
| lib/Db/SharedFolderMapper.php | Added IQueryBuilder import and PARAM_INT for shared-folder queries |
| lib/Db/ShareMapper.php | Added IQueryBuilder import and PARAM_INT for share queries and annotated exceptions |
| lib/Db/PublicFolderMapper.php | Added IQueryBuilder import and PARAM_INT for named parameters |
| lib/Db/FolderMapper.php | Added IQueryBuilder import and PARAM_INT for find and insert operations |
| lib/Db/BookmarkMapper.php | Added IQueryBuilder import and PARAM_INT for bookmark queries |
Comments suppressed due to low confidence (2)
lib/Db/SharedFolderMapper.php:222
- There's a typo in the constant name
PARAM_INTy. It should beIQueryBuilder::PARAM_INT.
->andWhere($qb->expr()->eq('s.type', $qb->createPositionalParameter($type, IQueryBuilder::PARAM_INTy)))
lib/Db/ShareMapper.php:51
- There is an extra semicolon (
;;) at the end of this line. Removing the duplicate semicolon will resolve the syntax error.
->where($qb->expr()->eq('id', $qb->createPositionalParameter($shareId, IQueryBuilder::PARAM_INT)));;
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
see floccusaddon/floccus#1983