? ? Pending

User tests: Successful: Unsuccessful:

avatar ReLater
ReLater
27 Aug 2018

Issue and solution reported by user jooomlaa at
https://forum.joomla.de/thread/6201-vermutl-fehler-in-libraries-vendor-joomla-archive-src-archive-php-beim-entpacken/

Summary of Changes

  • Correct target path of extracted gzip or gz archives.

Testing Instructions

  • Joomla staging with template protostar.

  • Configuration: error_reporting => Maximum

  • Configuration: debug => Yes

  • Crréate a folder /tmp/source/

  • Put a gzip file in it that shall be extracted.
    e.g. https://forum.joomla.de/core/attachment/2757-namen-fr-fenja-txt-gzip/

  • Enter following code in protostar index.php after line defined('_JEXEC') or die;

use Joomla\Archive\Archive;

$fileName = 'Namen_fr-Fenja.txt.gzip';

$archive = new Archive(array('tmp_path' => JFactory::getConfig()->get('tmp_path')));

$archiveName = JPATH_SITE . '/tmp/source/' . $fileName;
$extractDir = JPATH_SITE . '/tmp/target';
$archive->extract($archiveName, $extractDir);
exit;
  • Pay attention that folder /tmp/target doesn't exist before test.

  • Open protostar page in frontend that runs the code.

Expected result

  • A new folder /tmp/target/ with extracted file Namen_fr-Fenja in it

Actual result

  • A temporary file like gzip5b83db746bab9 in /tmp/
  • error page
Joomla\Filesystem\File::copy: Copy failed.
.../libraries/vendor/joomla/filesystem/src/File.php:94

Call stack
--
# | Function | Location
1 | () | JROOT/libraries/vendor/joomla/filesystem/src/File.php:94
2 | Joomla\Filesystem\File::copy() | JROOT/libraries/vendor/joomla/archive/src/Archive.php:115

Apply patch

  • Try again.
  • Beware that protostar page is just empty because of exit; in code above (= OK).
  • A new folder /tmp/target/ with extracted file Namen_fr-Fenja in it
  • The temporary file like gzip5b83db746bab9 is not present in folder /tmp/
avatar ReLater ReLater - open - 27 Aug 2018
avatar ReLater ReLater - change - 27 Aug 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Aug 2018
Category External Library Libraries Composer Change
avatar ReLater ReLater - change - 27 Aug 2018
Title
Folder::create $extractdir instead of $path
class Archive: Folder::create $extractdir instead of $path
avatar ReLater ReLater - edited - 27 Aug 2018
avatar ReLater ReLater - change - 27 Aug 2018
The description was changed
avatar ReLater ReLater - edited - 27 Aug 2018
avatar ReLater ReLater - change - 27 Aug 2018
The description was changed
avatar ReLater ReLater - edited - 27 Aug 2018
avatar ReLater ReLater - change - 27 Aug 2018
The description was changed
avatar ReLater ReLater - edited - 27 Aug 2018
avatar ReLater ReLater - change - 27 Aug 2018
The description was changed
avatar ReLater ReLater - edited - 27 Aug 2018
avatar mbabker
mbabker - comment - 27 Aug 2018

This needs to be fixed in the upstream repo.

avatar ReLater
ReLater - comment - 27 Aug 2018

I hope master branch there is correct joomla-framework/archive#16

avatar brianteeman
brianteeman - comment - 27 Aug 2018

closed as addressed upstream

avatar brianteeman brianteeman - change - 27 Aug 2018
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2018-08-27 12:13:48
Closed_By brianteeman
Labels Added: ? ?
avatar brianteeman brianteeman - close - 27 Aug 2018

Add a Comment

Login with GitHub to post a comment