Forum

4.0.5 - XLSX Import...
 
Notifications
Retirer tout

4.0.5 - XLSX Import error

11 Posts
2 Utilisateurs
0 Reactions
9,119 Vu
 CS
(@tancs)
Posts: 5
Active Member
Début du sujet
 
[#1516]

Hi, both the manual & auto import doesn't work (i tried version 4.0.4 and 4.0.5).

This xlsx attachment works using 3.4.4.


 
Posté : 12 Déc AM 08:1212
(@babynus)
Posts: 14952
Membre Admin
 

Ticket #1251 recorded


 
Posté : 12 Déc PM 12:1212
(@babynus)
Posts: 14952
Membre Admin
 

Fixed !

In /model/Importable.php, replace line 431

		require_once '../external/XLSXReader.php';

with

		require_once '../external/XLSXReader/XLSXReader.php';

Will be intergrated in next patch (very soon)


 
Posté : 12 Déc PM 16:1212
 CS
(@tancs)
Posts: 5
Active Member
Début du sujet
 

Tq baby for the fix.

How about the auto cron-import?


 
Posté : 13 Déc AM 06:1212
(@babynus)
Posts: 14952
Membre Admin
 

Cronned auto-import uses same functionality, so it will also use the fix.

But to take into account new code, you must stop-restart the cron.


 
Posté : 13 Déc PM 17:1212
 CS
(@tancs)
Posts: 5
Active Member
Début du sujet
 

Version 4.0.6: cron import works but I got these:

2013-12-16 04:41:18 ** ERROR ** cause = rename(../files/importActivity_20131203_1647.xlsx,../files/importdoneActivity_20131203_1647.xlsx): The process cannot access the file because it is being used by another process. (code: 32)

I've tried on a Win8 (using Defender) & XP (w/o antivirus software), so shouldn't be the antivirus locking issue.

Thanks!


 
Posté : 16 Déc AM 07:1212
(@babynus)
Posts: 14952
Membre Admin
 

Hi,

File can be locked because of previous unsuccessfull import.
Try to move this file manually.

Then restart CRON and try another new import.


 
Posté : 16 Déc PM 12:1212
 CS
(@tancs)
Posts: 5
Active Member
Début du sujet
 

Tested using clean installs and the imports were successful (please see the attached log).
Maybe there is a XLS reader bug not closing the file?

Even unsuccessful import, the program should close the file & move it the ERROR folder (according to ProjeQtOr.ppt slide #116).


 
Posté : 16 Déc PM 13:1212
(@babynus)
Posts: 14952
Membre Admin
 

Even unsuccessful import, the program should close the file & move it the ERROR folder (according to ProjeQtOr.ppt slide #116).

Yes, but if the bug is the impossibility to move the file, this may be difficult.


 
Posté : 16 Déc PM 14:1212
 CS
(@tancs)
Posts: 5
Active Member
Début du sujet
 

Patched.

=== modified file external/XLSXReader/XLSXReader.php
--- external/XLSXReader/XLSXReader.php	2013-12-17 02:57:28 +0000
+++ external/XLSXReader/XLSXReader.php	2013-12-17 02:49:06 +0000
@@ -59,6 +59,10 @@
       return $data;
     }
   }
+  
+  public function closeDaFile(){
+	$this->zip->close();
+  }
  
   // extract the shared string and the list of sheets
   protected function parse() {

=== modified file model/Importable.php
--- model/Importable.php	2013-12-17 02:57:28 +0000
+++ model/Importable.php	2013-12-17 02:48:40 +0000
@@ -432,6 +432,7 @@
 		$xlsx = new XLSXReader($fileName);
 		$sheet1 = $xlsx->getSheet(1);
 		$data = $sheet1->getData();
+		$xlsx->closeDaFile();
 		return $data;
 	}

 
Posté : 17 Déc AM 06:1212
(@babynus)
Posts: 14952
Membre Admin
 

Great fix :woohoo:

Will be included in next version 😉

thanks for your contribution.


 
Posté : 17 Déc PM 12:1212
Share:
Retour en haut