Skip to content

Commit

Permalink
Fix: Small bugfix for creating templates
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Hempel <Philipp.Hempel1@web.de>
  • Loading branch information
Hephi2 committed Jul 31, 2023
1 parent 7aefa91 commit cd88017
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions lib/Controller/Api1Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function deleteView(int $viewId): DataResponse {
}

// Shares

/**
* @NoAdminRequired
* @CORS
Expand Down Expand Up @@ -465,7 +465,7 @@ public function deleteColumn(int $columnId): DataResponse {
*/
public function indexTableRowsSimple(int $tableId, ?int $limit, ?int $offset): DataResponse {
return $this->handleError(function () use ($tableId, $limit, $offset) {
return $this->v1Api->getData($tableId, $limit, $offset, $this->userId,);
return $this->v1Api->getData($tableId, $limit, $offset, $this->userId);
});
}

Expand Down Expand Up @@ -538,7 +538,7 @@ public function deleteRow(int $rowId, int $viewId): DataResponse {
return $this->rowService->delete($rowId, $viewId, $this->userId);
});
}

/**
* @NoAdminRequired
* @CORS
Expand All @@ -551,7 +551,7 @@ public function createImport(int $viewId, string $path, bool $createMissingColum
}

// Api Function for backward compatibility

/**
* @NoAdminRequired
* @CORS
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/ViewMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function search(string $term = null, ?string $userId = null, ?int $limit
return $views;
}

private function enhanceByOwnership(View &$view): void {
private function enhanceByOwnership(View $view): void {
$view->setOwnership($this->tableMapper->findOwnership($view->getTableId()));
$view->resetUpdatedFields();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/PermissionsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function canDeleteRowsByViewId(int $viewId, ?string $userId = null): bool
*/
public function canDeleteRowsByTableId(int $tableId, ?string $userId = null): bool {
return $this->checkPermissionById($tableId, 'table', 'manage', $userId);

}


Expand Down Expand Up @@ -279,7 +279,7 @@ public function canDeleteShare(Share $item, ?string $userId = null): bool {

public function getSharedPermissionsIfSharedWithMe(int $elementId, ?string $elementType = 'table', string $userId = null): array {
try {
$shares = $this->shareMapper->findAllSharesForNodeFor($elementType, $elementId, $userId, 'user');
$shares = $this->shareMapper->findAllSharesForNodeFor($elementType, $elementId, $userId);
} catch (Exception $e) {
$this->logger->warning('Exception occured: '.$e->getMessage().' Permission denied.');
return [];
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/ShareService.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function delete(int $id): Share {
* @return Share
* @noinspection PhpUndefinedMethodInspection
*/
private function addReceiverDisplayName(Share &$share):Share {
private function addReceiverDisplayName(Share $share):Share {
if ($share->getReceiverType() === 'user') {
$share->setReceiverDisplayName($this->userHelper->getUserDisplayName($share->getReceiver()));
} elseif ($share->getReceiverType() === 'group') {
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TableService.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function findAll(?string $userId = null, bool $skipTableEnhancement = fal
*
* @noinspection PhpUndefinedMethodInspection
*/
private function enhanceTable(Table &$table, string $userId): void {
private function enhanceTable(Table $table, string $userId): void {
// add owner display name for UI
$this->addOwnerDisplayName($table);

Expand Down
3 changes: 0 additions & 3 deletions lib/Service/TableTemplateService.php
Original file line number Diff line number Diff line change
Expand Up @@ -776,9 +776,6 @@ private function createColumn(int $tableId, array $parameters, int $baseViewId):
// userId
$this->userId,

// tableId
$tableId,

// baseViewId
$baseViewId,

Expand Down
2 changes: 1 addition & 1 deletion lib/Service/ViewService.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function deleteByObject(View $view, ?string $userId = null): View {
*
* @noinspection PhpUndefinedMethodInspection
*/
private function enhanceView(View &$view, string $userId): void {
private function enhanceView(View $view, string $userId): void {
// add owner display name for UI
$view->setOwnerDisplayName($this->userHelper->getUserDisplayName($view->getOwnership()));

Expand Down

0 comments on commit cd88017

Please sign in to comment.