Fix some regresions

This commit is contained in:
Matias De lellis
2021-09-20 21:26:25 -03:00
parent 2d0d3fc975
commit eaa68be517
5 changed files with 6 additions and 4 deletions

View File

@@ -94,7 +94,7 @@ class SettingsController extends Controller {
switch ($type) { switch ($type) {
case SettingsService::COLOR_FOR_NEW_NOTES_KEY: case SettingsService::COLOR_FOR_NEW_NOTES_KEY:
$value = $this->settingsService->getColorForNewNotes($this->userId); $value = $this->settingsService->getColorForNewNotes();
break; break;
default: default:
$status = self::STATE_FALSE; $status = self::STATE_FALSE;

View File

@@ -31,6 +31,7 @@ use OCP\IRequest;
use OCA\QuickNotes\Db\NoteShare; use OCA\QuickNotes\Db\NoteShare;
use OCA\QuickNotes\Db\NoteShareMapper; use OCA\QuickNotes\Db\NoteShareMapper;
use OCP\AppFramework\Db\DoesNotExistException;
class ShareController extends Controller { class ShareController extends Controller {

View File

@@ -7,7 +7,7 @@ use OCP\AppFramework\Db\Entity;
/** /**
* @method void setColor(string $color) * @method void setColor(string $color)
* @method strinf getColor() * @method string getColor()
*/ */
class Color extends Entity implements JsonSerializable { class Color extends Entity implements JsonSerializable {

View File

@@ -30,7 +30,7 @@ class ColorMapper extends QBMapper {
$qb->select('*') $qb->select('*')
->from($this->tableName) ->from($this->tableName)
->where( ->where(
$qb->expr()->eq('color', $qb->createNamedParameter($color, IQueryBuilder::PARAM_STRING)) $qb->expr()->eq('color', $qb->createNamedParameter($color, IQueryBuilder::PARAM_STR))
); );
return $this->findEntity($qb); return $this->findEntity($qb);
} }

View File

@@ -43,6 +43,7 @@ use OCA\QuickNotes\Db\TagMapper;
use OCA\QuickNotes\Service\FileService; use OCA\QuickNotes\Service\FileService;
use OCA\QuickNotes\Service\SettingsService; use OCA\QuickNotes\Service\SettingsService;
use OCP\AppFramework\Db\DoesNotExistException;
class NoteService { class NoteService {
@@ -408,7 +409,7 @@ class NoteService {
// Get Note and Color // Get Note and Color
try { try {
$note = $this->notemapper->find($id, $userId); $note = $this->notemapper->find($id, $userId);
} catch(Exception $e) { } catch(DoesNotExistException $e) {
return; return;
} }
$oldcolorid = $note->getColorId(); $oldcolorid = $note->getColorId();