View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
18697Bug reportsImport/Exportpublic2023-04-01 18:02
Reporter2BITS_PL Assigned Toollehar  
PrioritynoneSeveritypartial_block 
Status assignedResolutionopen 
Product Version5.6.x 
Summary18697: Importing resources in IIS doesn't work.
Description

With the correct structure of the package, it is not possible to import resources, it always returns the message "This ZIP archive contains no valid Resources files. Import failed."

Steps To Reproduce

The main problem is in the PclZip library, firstly it adds './' to the beginning of the path - which is not correctly interpreted by WindowsServer.

The second serious problem is setting the paths to: images and files (they contain an incorrect directory separator) already at the level of the SurveyAdministrationController and the FilterImportedResources library.

For the reasons mentioned above, in the 'privExtractByRule' method, the files return the status "path_creation_fail".

TagsNo tags attached.
Bug heat10
Complete LimeSurvey version number (& build)Version 5.4.11+221114
I will donate to the project if issue is resolvedNo
Browser
Database type & versionSQL Server 2019
Server OS (if known)Microsoft Server 2019
Webserver software & version (if known)
PHP Versionv8.0.27 NTS x64

Users monitoring this issue

2BITS_PL, DenisChenu

Activities

ollehar

ollehar

2023-03-22 15:08

administrator   ~74228

You have a suggested fix for this?

ollehar

ollehar

2023-03-22 16:30

administrator   ~74239

And of course, always make sure to run the latest version. :)

DenisChenu

DenisChenu

2023-03-23 09:01

developer   ~74241

It work on 3.X ?

DenisChenu

DenisChenu

2023-03-23 10:27

developer   ~74242

Last edited: 2023-03-23 10:28

Seems broken on 3.27.26 (yes, i know : need to update)

Export resource from same server.

2BITS_PL

2BITS_PL

2023-03-30 13:30

reporter   ~74315

I performed tests in LS v5.6.13 (pure instance, without our dedicated plugins).

  1. I added two files to resources as in the screenshot.
  2. I made an export to a ZIP file (I'm sending a package)
  3. I go to the survey, I import the package, I get the message "This ZIP archive contains no valid resources files. Import failed."

I performed the tests on a new survey, as well as on the same one after deleting the resources, I always get the message from point 3.

ls_v5613_resources.png (51,263 bytes)   
ls_v5613_resources.png (51,263 bytes)   
2BITS_PL

2BITS_PL

2023-03-30 14:00

reporter   ~74316

After performing the fixes below, the issue was resolved.

  1. In these files I changed "/" to DIRECTORY_SEPARATOR
  2. delete the line:
    https://github.com/LimeSurvey/LimeSurvey/blob/master/vendor/pclzip/pclzip.lib.php#L3304
    Only with a change in the pclzip.lib.php file - this solves the problem on windows but for linux it will generate error
DenisChenu

DenisChenu

2023-03-30 14:55

developer   ~74317

Last edited: 2023-03-30 14:57

@2BITS_PL : can you create a pull request ?

[edited]

The pclzip.lib.php update are mandatory ?

2BITS_PL

2BITS_PL

2023-03-30 17:58

reporter   ~74318

This line in the pclzip.lib.php file adds "./" to the beginning of the path, creating the path: "./W:\code...\tmp\qCWfoZSMUQfn0RdqUCqGfCUqT7i62Ge4" and Windows cannot interpret it correctly.

I don't know if it makes sense to prepare a pull request, since the proposed solution is not comprehensive.
The problem with pczlib is that in the function privExtractByRule it goes to the first condition and changes the path to something IIS doesn't understand.

I actually don't know how to fix pczlib because I don't know enough about the project structure. The proposed solution is not good as it will solve the problem for windows but will create one for unix systems.
Here you need to change this code to work equally on both systems. Unfortunately, this library has slashes declared in many places, which can be problematic for IIS because it expects backslashes.

2BITS_PL

2BITS_PL

2023-03-30 18:06

reporter   ~74319

@DenisChenu https://github.com/LimeSurvey/LimeSurvey/pull/3027

Issue History

Date Modified Username Field Change
2023-03-21 10:24 2BITS_PL New Issue
2023-03-22 15:08 ollehar Note Added: 74228
2023-03-22 15:08 ollehar Bug heat 0 => 2
2023-03-22 16:30 ollehar Product Version => 5.6.x
2023-03-22 16:30 ollehar Note Added: 74239
2023-03-23 09:01 DenisChenu Note Added: 74241
2023-03-23 09:01 DenisChenu Bug heat 2 => 4
2023-03-23 10:04 ollehar Assigned To => ollehar
2023-03-23 10:04 ollehar Status new => feedback
2023-03-23 10:27 DenisChenu Note Added: 74242
2023-03-23 10:27 DenisChenu File Added: Capture d’écran du 2023-03-23 10-27-19.png
2023-03-23 10:28 DenisChenu Note Edited: 74242
2023-03-30 13:30 2BITS_PL Note Added: 74315
2023-03-30 13:30 2BITS_PL File Added: resources-survey-369156.zip
2023-03-30 13:30 2BITS_PL File Added: ls_v5613_resources.png
2023-03-30 13:30 2BITS_PL Bug heat 4 => 6
2023-03-30 13:30 2BITS_PL Status feedback => assigned
2023-03-30 14:00 2BITS_PL Note Added: 74316
2023-03-30 14:00 2BITS_PL File Added: fixed_import_resources_in_ls_v5613.png
2023-03-30 14:02 2BITS_PL Issue Monitored: 2BITS_PL
2023-03-30 14:02 2BITS_PL Bug heat 6 => 8
2023-03-30 14:55 DenisChenu Note Added: 74317
2023-03-30 14:57 DenisChenu Note Edited: 74317
2023-03-30 17:58 2BITS_PL Note Added: 74318
2023-03-30 18:06 2BITS_PL Note Added: 74319
2023-04-01 18:02 DenisChenu Issue Monitored: DenisChenu
2023-04-01 18:02 DenisChenu Bug heat 8 => 10