Skip to content

Commit

Permalink
fix: added missing error case
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Jul 21, 2024
1 parent 1fde281 commit 786ffa4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
4 changes: 4 additions & 0 deletions phpmyfaq/admin/assets/src/configuration/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ export const handleCheckForUpdates = () => {
card.classList.add('text-bg-warning');
result.replaceWith(addElement('p', { innerText: responseData.warning }));
}
if (responseData.error) {
card.classList.add('text-bg-danger');
result.replaceWith(addElement('p', { innerText: responseData.error }));
}
} catch (error) {
if (error.cause && error.cause.response) {
const errorMessage = await error.cause.response.json();
Expand Down
17 changes: 1 addition & 16 deletions phpmyfaq/src/phpMyFAQ/Setup/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,6 @@ public function checkFilesystem(): bool
throw new Exception('The folder /phpmyfaq/assets/themes is missing.');
}

if (!is_dir(PMF_CONTENT_DIR . '/user/attachments')) {
return false;
}

if (!is_dir(PMF_CONTENT_DIR . '/user/images')) {
return false;
}

if (!is_dir(PMF_CONTENT_DIR . '/core/data')) {
return false;
}

if (!is_dir(PMF_ROOT_DIR . '/assets/themes')) {
return false;
}

if (
is_file(PMF_CONTENT_DIR . '/core/config/constants.php') &&
is_file(PMF_CONTENT_DIR . '/core/config/database.php')
Expand All @@ -124,6 +108,7 @@ public function checkFilesystem(): bool

return true;
}

throw new Exception(
'The files /content/core/config/constant.php and /content/core/config/database.php are missing.'
);
Expand Down

0 comments on commit 786ffa4

Please sign in to comment.