fix billing process

This commit is contained in:
Dennis Eichhorn 2023-04-08 04:36:26 +02:00
parent 4035d30c35
commit a3268733c6
4 changed files with 16 additions and 10 deletions

View File

@ -8,9 +8,11 @@ assignees: ''
---
# Bug Description
A clear and concise description of what the bug is.
# How to Reproduce
Steps to reproduce the behavior:
1. Go to '...'
@ -19,16 +21,20 @@ Steps to reproduce the behavior:
4. See error
# Expected Behavior
A clear and concise description of what you expected to happen.
# Screenshots
If applicable, add screenshots to help explain your problem.
# System Information
- System: [e.g. PC or iPhone11, ...]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- KarakaVersion [e.g. 22]
- System: [e.g. PC or iPhone11, ...]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- KarakaVersion [e.g. 22]
# Additional Information
Add any other context about the problem here.

View File

@ -59,8 +59,8 @@ final class ApiController extends Controller
private function validateNewsCreate(RequestAbstract $request) : array
{
$val = [];
if (($val['title'] = empty($request->getData('title')))
|| ($val['plain'] = empty($request->getData('plain')))
if (($val['title'] = !$request->hasData('title'))
|| ($val['plain'] = !$request->hasData('plain'))
|| ($val['lang'] = (
$request->hasData('lang')
&& !ISO639x1Enum::isValidValue(\strtolower((string) $request->getData('lang')))
@ -334,7 +334,7 @@ final class ApiController extends Controller
$newsArticle->isFeatured = $request->getDataBool('featured') ?? true;
// allow comments
if (!empty($request->getData('allow_comments'))
if ($request->hasData('allow_comments')
&& !(($commentApi = $this->app->moduleManager->get('Comments')) instanceof NullModule)
) {
/** @var \Modules\Comments\Controller\ApiController $commentApi */

View File

@ -173,7 +173,7 @@ final class BackendController extends Controller implements DashboardElementInte
if ($article->createdBy->getId() !== $accountId
&& !$this->app->accountManager->get($accountId)->hasPermission(
PermissionType::READ, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::NEWS, $article->getId())
PermissionType::READ, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::NEWS, $article->getId())
) {
$view->setTemplate('/Web/Backend/Error/403_inline');
$response->header->status = RequestStatusCode::R_403;
@ -199,7 +199,7 @@ final class BackendController extends Controller implements DashboardElementInte
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000601001, $request, $response));
$view->addData('news', $article);
$view->addData('editable', $this->app->accountManager->get($accountId)->hasPermission(
PermissionType::MODIFY, $this->app->unitId, $this->app->appName, self::NAME, PermissionCategory::NEWS, $article->getId())
PermissionType::MODIFY, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::NEWS, $article->getId())
);
// allow comments

View File

@ -62,7 +62,7 @@ final class ControllerTest extends \PHPUnit\Framework\TestCase
$permission = new AccountPermission();
$permission->setUnit(1);
$permission->setApp('backend');
$permission->setApp(2);
$permission->setPermission(
PermissionType::READ
| PermissionType::CREATE