Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-7296

Style export to tar(.*) does not work

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.1
    • Fix Version/s: 3.0.8-RC1
    • Component/s: ACP
    • Labels:
      None
    • Environment:
      PHP Environment: 4.4.8
      Database: MySQL 5.0.27

      Description

      Hi devs,

      even if I try to export any style component by choosing any
      TAR format, it results in a damaged archive. ZIP archiving works smoothly. (tested with Total Commander 7 and WinRAR 3.7)

      Best regards
      easygo

      1. prosilver.tar
        172 kB
        easygo

        Activity

        Hide
        ToonArmy Chris Smith added a comment -

        Okay, seems this is only broken for templates. Using under windows, winrar and 7zip both report invalid archive. p7zip under Linux works fine. Language files seem to be exporting correctly.

        Show
        ToonArmy Chris Smith added a comment - Okay, seems this is only broken for templates. Using under windows, winrar and 7zip both report invalid archive. p7zip under Linux works fine. Language files seem to be exporting correctly.
        Hide
        ToonArmy Chris Smith added a comment -

        Could you upload or make available for download a tar file which is broken so we can investigate. Thanks.

        Show
        ToonArmy Chris Smith added a comment - Could you upload or make available for download a tar file which is broken so we can investigate. Thanks.
        Hide
        easygo easygo added a comment -

        Here you are! Thanks for your efforts.

        Show
        easygo easygo added a comment - Here you are! Thanks for your efforts.
        Hide
        orthello orthello added a comment -

        Experienced strange behaviour when exporting templates.
        Templates seem to exist multiple times in the export. I choose to download the .zip export.
        Breadcrumbs.html exists 140 times and in only two versions. 139 times with CRC: D1A6B4B7 and just 1 time with CRC: D96D161F.
        When unpacking an overwrite confirmation is popping up. Which is to be expected in this case.

        Same thing happens when exporting templates to a .tar or .zip in /store

        Please advice
        Using phpBB 3.0.6
        Did the auto update from 3.0.4 to 3.0.6
        I don't know if this behaviour was present before the update.

        Show
        orthello orthello added a comment - Experienced strange behaviour when exporting templates. Templates seem to exist multiple times in the export. I choose to download the .zip export. Breadcrumbs.html exists 140 times and in only two versions. 139 times with CRC: D1A6B4B7 and just 1 time with CRC: D96D161F. When unpacking an overwrite confirmation is popping up. Which is to be expected in this case. Same thing happens when exporting templates to a .tar or .zip in /store Please advice Using phpBB 3.0.6 Did the auto update from 3.0.4 to 3.0.6 I don't know if this behaviour was present before the update.
        Hide
        jmroth jmroth [X] (Inactive) added a comment - - edited

        On a closer look, the facts about the 2 "types" of tar file (store/download) are:

        they will have different MD5s and BOTH will not open in Windows (IZarc, 7-Zip), whereas both test fine under Linux. (tar tf)

        As far as the difference between store and download versions are concerned, I found only differences in what I believe are timestamps of the files inside the tar, so in fact both files are identical.

        Not sure why Windows is choking on them.

        Show
        jmroth jmroth [X] (Inactive) added a comment - - edited On a closer look, the facts about the 2 "types" of tar file (store/download) are: they will have different MD5s and BOTH will not open in Windows (IZarc, 7-Zip), whereas both test fine under Linux. (tar tf) As far as the difference between store and download versions are concerned, I found only differences in what I believe are timestamps of the files inside the tar, so in fact both files are identical. Not sure why Windows is choking on them.
        Hide
        A_Jelly_Doughnut A_Jelly_Doughnut added a comment -

        Using the attached prosilver.tar file, I was able to get the file to open simply by changing the line endings to UNIX in my text editor. I'm not sure at this point how that affects anything, and why it would not affect other applications of the compress_tar class.

        Show
        A_Jelly_Doughnut A_Jelly_Doughnut added a comment - Using the attached prosilver.tar file, I was able to get the file to open simply by changing the line endings to UNIX in my text editor. I'm not sure at this point how that affects anything, and why it would not affect other applications of the compress_tar class.
        Hide
        nickvergessen Joas Schilling added a comment -

        Language files seem to be exporting correctly.

        This might be caused by a broken function on the compress-class.
        because language uses

        			// Add file to archive
        			$compress->add_custom_file($phpbb_root_path . $source, $destination);

        while in the style we use

        					foreach ($files as $file_ary)
        					{
        						$compress->add_file($file_ary['src'], $file_ary['prefix-'], $file_ary['prefix+'], $file_ary['exclude']);
        					}


        You can work around, by replacing the

        						$compress->add_file($file_ary['src'], $file_ary['prefix-'], $file_ary['prefix+'], $file_ary['exclude']);

        with

        						$dir_files = filelist($phpbb_root_path . $file_ary['src'], '', '*');
        						$dir_files = (isset($dir_files[''])) ? $dir_files[''] : array();
         
        						$src_path = ($file_ary['prefix-']) ? preg_replace('#^(' . preg_quote($file_ary['prefix-'], '#') . ')#', '', $file_ary['src']) : $file_ary['src'];
        						$src_path = ($file_ary['prefix+']) ? ($file_ary['prefix+'] . ((substr($file_ary['prefix+'], -1) != '/') ? '/' : '') . $src_path) : $src_path;
        						$src_path = (substr($src_path, 0, 1) == '/') ? substr($src_path, 1) : $src_path;
         
        						foreach ($dir_files as $file)
        						{
        							if (strpos($file_ary['exclude'], $file) === false)
        							{
        								$compress->add_custom_file($phpbb_root_path . $file_ary['src'] . $file, $src_path . $file);//($file_ary['src'], $file_ary['prefix-'], $file_ary['prefix+'], $file_ary['exclude']);
        							}
        						}


        but the existing function must be fixed.

        Show
        nickvergessen Joas Schilling added a comment - Language files seem to be exporting correctly. This might be caused by a broken function on the compress-class. because language uses // Add file to archive $compress->add_custom_file($phpbb_root_path . $source, $destination); while in the style we use foreach ($files as $file_ary) { $compress->add_file($file_ary['src'], $file_ary['prefix-'], $file_ary['prefix+'], $file_ary['exclude']); } You can work around, by replacing the $compress->add_file($file_ary['src'], $file_ary['prefix-'], $file_ary['prefix+'], $file_ary['exclude']); with $dir_files = filelist($phpbb_root_path . $file_ary['src'], '', '*'); $dir_files = (isset($dir_files[''])) ? $dir_files[''] : array();   $src_path = ($file_ary['prefix-']) ? preg_replace('#^(' . preg_quote($file_ary['prefix-'], '#') . ')#', '', $file_ary['src']) : $file_ary['src']; $src_path = ($file_ary['prefix+']) ? ($file_ary['prefix+'] . ((substr($file_ary['prefix+'], -1) != '/') ? '/' : '') . $src_path) : $src_path; $src_path = (substr($src_path, 0, 1) == '/') ? substr($src_path, 1) : $src_path;   foreach ($dir_files as $file) { if (strpos($file_ary['exclude'], $file) === false) { $compress->add_custom_file($phpbb_root_path . $file_ary['src'] . $file, $src_path . $file);//($file_ary['src'], $file_ary['prefix-'], $file_ary['prefix+'], $file_ary['exclude']); } } but the existing function must be fixed.
        Hide
        nickvergessen Joas Schilling added a comment -

        Add the folders to the archive before putting the files inside, seems to break the tar-archives.

        Show
        nickvergessen Joas Schilling added a comment - Add the folders to the archive before putting the files inside, seems to break the tar-archives.

          People

          • Assignee:
            nickvergessen Joas Schilling
            Reporter:
            unknown user unknown user
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development