Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions .github/scripts/generate-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,31 @@ if [ -n "$LATEST_STABLE_NC_VERSION" ]; then
latestStableNCVersion="stable$latestStableNCVersion"
fi
else
# determine latest stable version from the list
# this only takes into account the major version number and stable branches
# e.g. 30, stable30
for ncVersion in $nextcloudVersions; do
# parse the major version number from stable branch
# e.g. stable30 -> 30
if [[ "$ncVersion" =~ ^stable[0-9]+$ ]]; then
ncVersion=${ncVersion//stable/}
fi
if ! [[ "$ncVersion" =~ ^[0-9]+$ ]]; then
continue
fi
if [ -z "$latestStableNCVersion" ]; then
latestStableNCVersion=$ncVersion
continue
fi
if [ "$ncVersion" -gt "$latestStableNCVersion" ]; then
latestStableNCVersion=$ncVersion
fi
done
latestStableNCVersion="stable$latestStableNCVersion"
if [ $(echo "$nextcloudVersions" | wc -w) -eq 1 ]; then
latestStableNCVersion="$nextcloudVersions"
else
# determine latest stable version from the list
# this only takes into account the major version number and stable branches
# e.g. 30, stable30
for ncVersion in $nextcloudVersions; do
# parse the major version number from stable branch
# e.g. stable30 -> 30
if [[ "$ncVersion" =~ ^stable[0-9]+$ ]]; then
ncVersion=${ncVersion//stable/}
fi
if ! [[ "$ncVersion" =~ ^[0-9]+$ ]]; then
continue
fi
if [ -z "$latestStableNCVersion" ]; then
latestStableNCVersion=$ncVersion
continue
fi
if [ "$ncVersion" -gt "$latestStableNCVersion" ]; then
latestStableNCVersion=$ncVersion
fi
done
latestStableNCVersion="stable$latestStableNCVersion"
fi
fi

MATRIX=""
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shared_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
nextcloud_versions:
required: false
type: string
default: "33 master"
default: "master"
php_versions:
required: false
type: string
Expand Down
7 changes: 4 additions & 3 deletions lib/Controller/FilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use OCP\Files\DavUtil;
use OCP\Files\FileInfo;
use OCP\Files\IRootFolder;
use OCP\Files\Node;
use OCP\IDBConnection;
use OCP\IRequest;
use OCP\IUser;
Expand Down Expand Up @@ -185,7 +186,7 @@ private function compileFileInfo($fileId) {
// full path is in format `<user-name>/files/a/b/`
// since we don't want to send it with username, only get the `files/a/b` and send it
$path = explode('/', $fullpath, 3);
$davPermission = $this->getDavPermissions($file);
$davPermission = $this->getDavPermissions($file, $file->getParent());
if ($file->getMimeType() === FileInfo::MIMETYPE_FOLDER) {
$mimeType = 'application/x-op-directory';
$path = $path[2] . '/';
Expand Down Expand Up @@ -289,7 +290,7 @@ private function getLastModifier(string $ownerId, int $fileId, int $since = 0):

// `davUtils->getDavPermissions` method is static so it cannot be mocked to
// creating similar function here for testing purposes
public function getDavPermissions(FileInfo $info): string {
return $this->davUtils->getDavPermissions($info);
public function getDavPermissions(FileInfo $info, Node $parent): string {
return $this->davUtils->getDavPermissions($info, $parent);
}
}
Loading