Skip to content

Commit

Permalink
fix: fix note controller user id param
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliushaertl committed Sep 5, 2023
1 parent b735aa0 commit 50460d5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/Controller/NotesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class NotesController extends Controller {
private IConfig $settings;
private IL10N $l10n;
private IMimeTypeDetector $mimeTypeDetector;
private string $userId;

public function __construct(
string $AppName,
Expand All @@ -40,7 +39,6 @@ public function __construct(
IConfig $settings,
IL10N $l10n,
IMimeTypeDetector $mimeTypeDetector,

Check warning on line 41 in lib/Controller/NotesController.php

View workflow job for this annotation

GitHub Actions / lint-php (min)

Cannot use trailing commas in parameter or closure use lists before php 8.0 in declaration of (unknown). NOTE: THIS ISSUE CAN ONLY DETECTED BY THE POLYFILL.

Check warning on line 41 in lib/Controller/NotesController.php

View workflow job for this annotation

GitHub Actions / lint-php (max)

Cannot use trailing commas in parameter or closure use lists before php 8.0 in declaration of (unknown). NOTE: THIS ISSUE CAN ONLY DETECTED BY THE POLYFILL.
string $userId
) {

Check failure on line 42 in lib/Controller/NotesController.php

View workflow job for this annotation

GitHub Actions / lint-php (min)

syntax error, unexpected ')', expecting variable (T_VARIABLE)
parent::__construct($AppName, $request);
$this->notesService = $notesService;
Expand All @@ -50,7 +48,6 @@ public function __construct(
$this->settings = $settings;
$this->l10n = $l10n;
$this->mimeTypeDetector = $mimeTypeDetector;
$this->userId = $userId;
}

/**
Expand Down Expand Up @@ -350,11 +347,11 @@ public function uploadFile(int $noteid): JSONResponse {
}

private function inLockScope(Note $note, callable $callback) {
$isRichText = $this->settingsService->get($this->userId, 'noteMode') === 'rich';
$isRichText = $this->settingsService->get($this->helper->getUID(), 'noteMode') === 'rich';
$lockContext = new LockContext(
$note->getFile(),
$isRichText ? ILock::TYPE_APP : ILock::TYPE_USER,
$isRichText ? 'text' : $this->userId
$isRichText ? 'text' : $this->helper->getUID()
);
$this->lockManager->runInScope($lockContext, function () use ($callback) {
$callback();
Expand Down

0 comments on commit 50460d5

Please sign in to comment.