diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2016-01-15 23:17:22 +0000 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2016-01-15 23:17:22 +0000 |
commit | 0b7fc9fd11394bf1e4ee13de8210678bd3c1f80d (patch) | |
tree | f0d622fce14e60d9d1aebecbe209914b35b5a40c /apps/files_external/service | |
parent | fcec704174a384f93214a1f2b83bed385e763ff6 (diff) | |
download | nextcloud-server-0b7fc9fd11394bf1e4ee13de8210678bd3c1f80d.tar.gz nextcloud-server-0b7fc9fd11394bf1e4ee13de8210678bd3c1f80d.zip |
Correctly remove global applicable
Diffstat (limited to 'apps/files_external/service')
-rw-r--r-- | apps/files_external/service/dbconfigservice.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/files_external/service/dbconfigservice.php b/apps/files_external/service/dbconfigservice.php index 94debcd7ebe..d52bf51e4aa 100644 --- a/apps/files_external/service/dbconfigservice.php +++ b/apps/files_external/service/dbconfigservice.php @@ -294,8 +294,14 @@ class DBConfigService { $builder = $this->connection->getQueryBuilder(); $query = $builder->delete('external_applicable') ->where($builder->expr()->eq('mount_id', $builder->createNamedParameter($mountId, \PDO::PARAM_INT))) - ->andWhere($builder->expr()->eq('type', $builder->createNamedParameter($type, \PDO::PARAM_INT))) - ->andWhere($builder->expr()->eq('value', $builder->createNamedParameter($value, \PDO::PARAM_STR))); + ->andWhere($builder->expr()->eq('type', $builder->createNamedParameter($type, \PDO::PARAM_INT))); + + if (is_null($value)) { + $query = $query->andWhere($builder->expr()->isNull('value')); + } else { + $query = $query->andWhere($builder->expr()->eq('value', $builder->createNamedParameter($value, \PDO::PARAM_STR))); + } + $query->execute(); } |