diff --git a/.github/scripts/generate-matrix.sh b/.github/scripts/generate-matrix.sh index a0a714e70..9ff9816c7 100755 --- a/.github/scripts/generate-matrix.sh +++ b/.github/scripts/generate-matrix.sh @@ -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="" diff --git a/.github/workflows/shared_workflow.yml b/.github/workflows/shared_workflow.yml index ac03c1ddd..de7d57942 100644 --- a/.github/workflows/shared_workflow.yml +++ b/.github/workflows/shared_workflow.yml @@ -10,7 +10,7 @@ on: nextcloud_versions: required: false type: string - default: "33 master" + default: "master" php_versions: required: false type: string diff --git a/lib/Controller/FilesController.php b/lib/Controller/FilesController.php index b7078928c..5ef4bae43 100644 --- a/lib/Controller/FilesController.php +++ b/lib/Controller/FilesController.php @@ -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; @@ -185,7 +186,7 @@ private function compileFileInfo($fileId) { // full path is in format `/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] . '/'; @@ -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); } }