Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.1] Fix fatal error during Joomla update #42976

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use Joomla\CMS\Table\Table;
use Joomla\CMS\Uri\Uri;
use Joomla\Database\ParameterType;
use Joomla\Filesystem\Path;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -573,8 +572,6 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'folders_deleted' => [],
'files_errors' => [],
'folders_errors' => [],
'folders_checked' => [],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For someone does code review, the two array elements definition here could be removed because it is immediately overwrite later at https://github.com/joomla/joomla-cms/blob/5.1-dev/administrator/components/com_admin/script.php#L2539-L2540

'files_checked' => [],
];

$files = [
Expand Down Expand Up @@ -2540,7 +2537,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
$status['folders_checked'] = $folders;

foreach ($files as $file) {
if ($fileExists = is_file(JPATH_ROOT . $file)) {
if (is_file(JPATH_ROOT . $file)) {
$status['files_exist'][] = $file;

if ($dryRun === false) {
Expand All @@ -2554,7 +2551,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
}

foreach ($folders as $folder) {
if ($folderExists = is_dir(Path::clean(JPATH_ROOT . $folder))) {
if (is_dir(JPATH_ROOT . $folder)) {
$status['folders_exist'][] = $folder;

if ($dryRun === false) {
Expand Down