Skip to content

Commit

Permalink
fix: adding categories without category images was not possible, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Dec 9, 2024
1 parent 112aaa0 commit 8a4ed75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions phpmyfaq/admin/category.main.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// Image upload
//
$request = Request::createFromGlobals();
$uploadedFile = $request->files->get('image');
$uploadedFile = $request->files->get('image') ?? [];
$categoryImage = new Image($faqConfig);
$categoryImage->setUploadedFile($uploadedFile);

Expand Down Expand Up @@ -75,9 +75,9 @@
->setName(Filter::filterInput(INPUT_POST, 'name', FILTER_SANITIZE_SPECIAL_CHARS))
->setDescription(Filter::filterInput(INPUT_POST, 'description', FILTER_SANITIZE_SPECIAL_CHARS))
->setUserId(Filter::filterInput(INPUT_POST, 'user_id', FILTER_VALIDATE_INT))
->setGroupId(Filter::filterInput(INPUT_POST, 'group_id', FILTER_VALIDATE_INT))
->setGroupId(Filter::filterInput(INPUT_POST, 'group_id', FILTER_VALIDATE_INT) ?? -1)
->setActive(Filter::filterInput(INPUT_POST, 'active', FILTER_VALIDATE_INT) ?? false)
->setImage($categoryImage->getFileName($categoryId, $categoryLang))
->setImage($categoryImage->getFileName($categoryId, $categoryLang) ?? '')
->setParentId($parentId)
->setShowHome(Filter::filterInput(INPUT_POST, 'show_home', FILTER_VALIDATE_INT));

Expand Down

0 comments on commit 8a4ed75

Please sign in to comment.