Skip to content

Commit

Permalink
[4.0] (#34910) Updating or uninstalling one library no longer removes…
Browse files Browse the repository at this point in the history
… another when both belong to same vendor.

### Summary of Changes
Check if there are any other children before removing vendor folder.

### Testing instructions
As described in #34910
  • Loading branch information
BrainforgeUK committed Jul 28, 2021
1 parent c9d977f commit b5edd01
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libraries/src/Installer/Adapter/LibraryAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,12 @@ protected function removeExtensionFiles()
// Delete empty vendor folders
if (2 === \count($elementParts))
{
Folder::delete(JPATH_MANIFESTS . '/libraries/' . $elementParts[0]);
Folder::delete(JPATH_PLATFORM . '/' . $elementParts[0]);
$folders = Folder::folders(JPATH_PLATFORM . '/' . $elementParts[0], '.', false, true, array(), array());
if (empty($folders))
{
Folder::delete(JPATH_MANIFESTS . '/libraries/' . $elementParts[0]);
Folder::delete(JPATH_PLATFORM . '/' . $elementParts[0]);
}
}
}

Expand Down

0 comments on commit b5edd01

Please sign in to comment.