Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $shallow arg to ShareByCircleProvider::getSharesInFolder #1117

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

artonge
Copy link
Contributor

@artonge artonge commented Jul 27, 2022

A new $shallow argument was introduced to IShareProvider::getSharesInFolder in NC25 by nextcloud/server#31728.

This PR adds this new argument and the necessary changes to make it work based on this example https://github.com/nextcloud/server/pull/31728/files#diff-dee1351696d7eae959761edf66c8e5a9052e28be73319733d857a9ab2d9fc967=

Looks like in the context of ShareWrapperRequest, the $shallow argument can't be used as we only have the nodeId so we cannot use the same method as in other places:

if ($shallow) {
	$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
} else {
	$qb->andWhere($qb->expr()->like('f.path', $qb->createNamedParameter($this->dbConnection->escapeLikeParameter($node->getInternalPath()) . '/%')));
}

Should we change the methods to forward $node instead of $nodeId?

@artonge artonge added this to the Nextcloud 25 milestone Jul 27, 2022
@artonge artonge self-assigned this Jul 27, 2022
@artonge artonge changed the title Add $shallow arg to ShareByCircleProvider::getSharesInFolder Add $shallow arg to ShareByCircleProvider::getSharesInFolder Jul 27, 2022
@artonge artonge changed the title Add $shallow arg to ShareByCircleProvider::getSharesInFolder Add $shallow arg to RoomShareProvider::getSharesInFolder Jul 27, 2022
@artonge artonge changed the title Add $shallow arg to RoomShareProvider::getSharesInFolder Add $shallow arg to ShareByCircleProvider::getSharesInFolder Jul 27, 2022
lib/Db/ShareWrapperRequest.php Outdated Show resolved Hide resolved
lib/Service/ShareWrapperService.php Outdated Show resolved Hide resolved
lib/ShareByCircleProvider.php Show resolved Hide resolved
lib/ShareByCircleProviderDeprecated.php Show resolved Hide resolved
@ArtificialOwl
Copy link
Member

ArtificialOwl commented Jul 27, 2022

Yes, it seems you can pass Folder (Node ?) instead of int in

(!is_null($node)) ? $node->getId() : 0,
without affecting the rest of the app

Not sure if $node can still really be null at this point of the process

@ArtificialOwl
Copy link
Member

also, for the sql requestion (around

) you can test:

$qb->like('path', $node->getInternalPath() . '/%', $aliasFileCache);

@artonge artonge force-pushed the feat/adapt_ShareByCircleProvider_to_new_interface branch 3 times, most recently from 402d6c3 to 217fd60 Compare July 27, 2022 11:30
Copy link
Member

@ArtificialOwl ArtificialOwl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no tested, looks good !

A new `$shallow` argument was introduced to `IShareProvider::getSharesInFolder` in NC25 by nextcloud/server#31728.

This PR adds this new argument and the necessary changes to make it work based on this example https://github.com/nextcloud/server/pull/31728/files#diff-dee1351696d7eae959761edf66c8e5a9052e28be73319733d857a9ab2d9fc967=

Signed-off-by: Louis Chemineau <[email protected]>
@artonge artonge force-pushed the feat/adapt_ShareByCircleProvider_to_new_interface branch from 217fd60 to 1538c2d Compare July 27, 2022 11:53
@artonge artonge merged commit 943934d into master Jul 27, 2022
@delete-merged-branch delete-merged-branch bot deleted the feat/adapt_ShareByCircleProvider_to_new_interface branch July 27, 2022 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants