?
avatar BrainforgeUK
BrainforgeUK
26 Jul 2021

Steps to reproduce the issue

Create 2 libraries with the manifest libraryname field as follows:

<libraryname>mycompany/mylibrary1</libraryname>

<libraryname>mycompany/mylibrary2</libraryname>

Both successfully installed and accessible / usable by my component.

Make a change to mylibrary1 and install the new version (do not uninstall ... just run the installer).

Expected result

mylibrary1 updated.
mylibrary2 not changed.

Actual result

mylibrary1 updated.
mylibrary2 files in JPATH_SITE/libraries/mycompany/mylibrary2 removed.

Have to uninstall both libraries and install both again.

System information (as much as possible)

Windows 10
PHP 7.4

Additional comments

Problem at lines 310-314 of Installer/Adapter/LibraryAdapter.php

These should read:
if (2 === \count($elementParts))
{
Folder::delete(JPATH_MANIFESTS . '/libraries/' . $elementParts[0] . '/' . $elementParts[1]);
Folder::delete(JPATH_PLATFORM . '/' . $elementParts[0] . '/' . $elementParts[1]);
}

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar BrainforgeUK BrainforgeUK - open - 26 Jul 2021
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Jul 2021
avatar brianteeman
brianteeman - comment - 26 Jul 2021

As you have a proposed fix please submit a pull request

avatar BrainforgeUK
BrainforgeUK - comment - 26 Jul 2021

Correction to Additional Comments - suggested code change should read...

if (2 === \count($elementParts))
{
$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]);
}
}


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34910.
avatar richard67 richard67 - change - 28 Jul 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-07-28 14:02:21
Closed_By richard67
avatar richard67 richard67 - close - 28 Jul 2021
avatar richard67
richard67 - comment - 28 Jul 2021

Closing as having a pull request.

@BrainforgeUK It would save us time if you would close your issue yourself when having made yourself a pull request to solve it.

Add a Comment

Login with GitHub to post a comment