Skip to content

Commit 82c9bca

Browse files
committed
Fix num_shares_link_no_password for NC >= 15
It says in https://github.com/nextcloud/server/blob/master/apps/files_sharing/lib/Controller/ShareAPIController.php: "share_with" and "share_with_displayname" for passwords of link shares was deprecated in Nextcloud 15, use "password" instead. Signed-off-by: orandev <63342732+orandev@users.noreply.github.com>
1 parent 31bc106 commit 82c9bca

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/ShareStatistics.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,17 @@ protected function countEntries($tableName) {
9090

9191
/**
9292
* @param int $type
93-
* @param bool $noShareWith
93+
* @param bool $noPassword
9494
* @return int
9595
*/
96-
protected function countShares($type, $noShareWith = false) {
96+
protected function countShares($type, $noPassword = false) {
9797
$query = $this->connection->getQueryBuilder();
9898
$query->selectAlias($query->createFunction('COUNT(*)'), 'num_entries')
9999
->from('share')
100100
->where($query->expr()->eq('share_type', $query->createNamedParameter($type)));
101101

102-
if ($noShareWith) {
103-
$query->andWhere($query->expr()->isNull('share_with'));
102+
if ($noPassword) {
103+
$query->andWhere($query->expr()->isNull('password'));
104104
}
105105

106106
$result = $query->execute();

0 commit comments

Comments
 (0)