diff --git a/Makefile b/Makefile index 156d598c..3bc0fcee 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ local: build docker compose kill || true docker stop nextcloud-container || true docker container rm nextcloud-container || true - docker run --rm -d -p 8080:80 --name nextcloud-container -e SERVER_BRANCH="v31.0.8" -v .:/var/www/html/apps-extra/gdatavaas ghcr.io/juliusknorr/nextcloud-dev-php84:latest + docker run --rm -d -p 8080:80 --name nextcloud-container -e SERVER_BRANCH="v32.0.0" -v .:/var/www/html/apps-extra/gdatavaas ghcr.io/juliusknorr/nextcloud-dev-php84:latest composer install # Builds the app for production and prepares it for the appstore under ./build/artifacts diff --git a/appinfo/info.xml b/appinfo/info.xml index c76d3d1a..362d6388 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -55,7 +55,7 @@ Please make sure the "Authentication Method" "Resource Owner Password Flow" is s pgsql mysql sqlite - + OCA\GDataVaas\BackgroundJobs\ScanJob diff --git a/composer.json b/composer.json index 1f99715d..56f2e8ca 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "coduo/php-humanizer": "5.0.0" }, "require-dev": { - "nextcloud/ocp": "v31.0.8", + "nextcloud/ocp": "v32.0.0", "psalm/phar": "6.8.2", "nextcloud/coding-standard": "v1.4.0", "colinodell/psr-testlogger": "1.3.0", @@ -45,4 +45,4 @@ "php": "8.1" } } -} +} \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 7a5cf344..8cf5dd78 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,7 +4,7 @@ services: nextcloud-container: - image: nextcloud:31.0.8 + image: nextcloud:32.0.0 ports: - "8080:80" container_name: nextcloud-container diff --git a/lib/EventListener/FileEventsListener.php b/lib/EventListener/FileEventsListener.php index d454c5c7..76b11adf 100644 --- a/lib/EventListener/FileEventsListener.php +++ b/lib/EventListener/FileEventsListener.php @@ -7,7 +7,6 @@ namespace OCA\GDataVaas\EventListener; use Exception; -use OC_Template; use OCA\GDataVaas\AppInfo\Application; use OCA\GDataVaas\Exceptions\VirusFoundException; use OCA\GDataVaas\Service\FileService; @@ -15,6 +14,7 @@ use OCA\GDataVaas\Service\TagService; use OCA\GDataVaas\Service\VerdictService; use OCP\AppFramework\Bootstrap\IRegistrationContext; +use OCP\AppFramework\Http\TemplateResponse; use OCP\EventDispatcher\Event; use OCP\EventDispatcher\IEventListener; use OCP\Files\Events\Node\NodeWrittenEvent; @@ -27,6 +27,7 @@ use OCP\IRequest; use OCP\IUserSession; use OCP\Lock\LockedException; +use OCP\Template\ITemplateManager; use Psr\Log\LoggerInterface; use Sabre\DAV\Server; @@ -42,6 +43,7 @@ public function __construct( private readonly TagService $tagService, private readonly IAppConfig $appConfig, private readonly MailService $mailService, + private readonly ITemplateManager $templateManager, ) { } @@ -115,17 +117,17 @@ private function sendErrorResponse(Exception $ex): void { public function generateBody(Exception $ex): string { if ($this->acceptHtml()) { - $renderAs = 'guest'; + $renderAs = TemplateResponse::RENDER_AS_GUEST; $templateName = 'exception'; } else { $templateName = 'xml_exception'; - $renderAs = null; + $renderAs = TemplateResponse::RENDER_AS_BLANK; $this->server->httpResponse->setHeader('Content-Type', 'application/xml; charset=utf-8'); } $debug = $this->config->getSystemValueBool('debug'); - $content = new OC_Template('gdatavaas', $templateName, $renderAs); + $content = $this->templateManager->getTemplate('gdatavaas', $templateName, $renderAs); $content->assign('title', 'Error'); $content->assign('message', $ex->getMessage()); $content->assign('remoteAddr', $this->request->getRemoteAddress()); diff --git a/scripts/get-nc-server.sh b/scripts/get-nc-server.sh index b2d1c092..b0be2688 100755 --- a/scripts/get-nc-server.sh +++ b/scripts/get-nc-server.sh @@ -5,7 +5,7 @@ # SPDX-License-Identifier: AGPL-3.0-or-later rm -rf nextcloud-server/ -export NEXTCLOUD_VERSION=${1:-31.0.8} +export NEXTCLOUD_VERSION=${1:-32.0.0} git clone --depth 1 --recurse-submodules --single-branch --branch v"$NEXTCLOUD_VERSION" https://github.com/nextcloud/server.git ./nextcloud-server cd nextcloud-server || exit 1 git submodule update --init diff --git a/scripts/run-app.sh b/scripts/run-app.sh index 94ef9044..2a0c0b31 100755 --- a/scripts/run-app.sh +++ b/scripts/run-app.sh @@ -6,7 +6,7 @@ set -e -export NEXTCLOUD_VERSION=${1:-31.0.8} +export NEXTCLOUD_VERSION=${1:-32.0.0} export IS_CI=${2:-0} if [ "$IS_CI" -eq 0 ]; then