Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029329Openbravo ERPA. Platformpublic2015-03-18 10:452016-06-17 19:36
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
3.0PR15Q2 
AugustoMauch
Core
No
0029329: can't download attachments for 2 files with same name and without extension
If two different records have attached a file with the same name which has not extension, it fails when trying to download attachments for the two files at once.
-Crate file: echo a > /tmp/a
-Open Sales Order
-Attach /tmp/a to record with docNo 1000000
-Attach /tmp/a to record with docNo 1000001
-Go to grid view and select records 1000000 and 1000001
-Click on attachments toolbar button and try to download
  --> ERROR: openbravo.log shows:
867f0e26 1041029 [http-8080-1] ERROR org.openbravo.erpCommon.businessUtility.TabAttachments - Error while downloading attachments
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1911)
    at org.openbravo.erpCommon.businessUtility.TabAttachments.printPageFileMultiple(TabAttachments.java:311)

- Try to open downloaded zip file
  --> ERROR: it can't be opened as it is currupt
No tags attached.
related to defect 00293133.0PR15Q2 closed alostale Download attachments selecting several records is not working fine 
Issue History
2015-03-18 10:45alostaleNew Issue
2015-03-18 10:45alostaleAssigned To => alostale
2015-03-18 10:45alostaleModules => Core
2015-03-18 10:45alostaleTriggers an Emergency Pack => No
2015-03-18 10:45alostaleRelationship addedrelated to 0029313
2015-03-18 10:46alostaleReview Assigned To => AugustoMauch
2015-03-18 10:51hgbotCheckin
2015-03-18 10:51hgbotNote Added: 0075727
2015-03-18 10:51hgbotStatusnew => resolved
2015-03-18 10:51hgbotResolutionopen => fixed
2015-03-18 10:51hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e7c1d9e51ba80ec128229240fcd37cdb020ad051 [^]
2015-03-20 12:20AugustoMauchNote Added: 0075788
2015-03-20 12:20AugustoMauchStatusresolved => closed
2015-03-20 12:20AugustoMauchFixed in Version => 3.0PR15Q2
2015-03-20 19:23hudsonbotCheckin
2015-03-20 19:23hudsonbotNote Added: 0075830
2016-04-18 13:02hgbotCheckin
2016-04-18 13:02hgbotNote Added: 0085697
2016-04-18 13:02hgbotStatusclosed => resolved
2016-04-18 13:02hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/e7c1d9e51ba80ec128229240fcd37cdb020ad051 [^] => http://code.openbravo.com/erp/devel/pi/rev/05e26fa3fabe5a8585f931e2d5a7381068ab5def [^]
2016-04-19 09:55gorkaionNote Added: 0085735
2016-04-19 09:55gorkaionStatusresolved => closed
2016-06-17 19:36hudsonbotCheckin
2016-06-17 19:36hudsonbotNote Added: 0087456

Notes
(0075727)
hgbot   
2015-03-18 10:51   
Repository: erp/devel/pi
Changeset: e7c1d9e51ba80ec128229240fcd37cdb020ad051
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Mar 18 10:50:25 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e7c1d9e51ba80ec128229240fcd37cdb020ad051 [^]

fixed bug 29329: can't download attachments for 2 rows with same name & no ext

  When trying to download at once attachemnts for different records that have the
  same name and it does not have extension, it fails.

  The problem is in case of duplicated names to be included within the zipped file,
  a number is appended to the file name before the extension. Extesion is present
  is assumed, failing if not.

  Fix: don't assume file name has extension.

---
M src/org/openbravo/erpCommon/businessUtility/TabAttachments.java
---
(0075788)
AugustoMauch   
2015-03-20 12:20   
Code reviewed and verified in pi@b7fd6844f03f
(0075830)
hudsonbot   
2015-03-20 19:23   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/a670497786d1 [^]
Maturity status: Test
(0085697)
hgbot   
2016-04-18 13:02   
Repository: erp/devel/pi
Changeset: 05e26fa3fabe5a8585f931e2d5a7381068ab5def
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Mar 18 10:50:25 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/05e26fa3fabe5a8585f931e2d5a7381068ab5def [^]

fixed bug 29329: can't download attachments for 2 rows with same name & no ext

  When trying to download at once attachemnts for different records that have the
  same name and it does not have extension, it fails.

  The problem is in case of duplicated names to be included within the zipped file,
  a number is appended to the file name before the extension. Extesion is present
  is assumed, failing if not.

  Fix: don't assume file name has extension.

---
M src/org/openbravo/erpCommon/businessUtility/TabAttachments.java
---
(0085735)
gorkaion   
2016-04-19 09:55   
issue reopened by attachment enhancement project merge. checked that it is not reproduced.
(0087456)
hudsonbot   
2016-06-17 19:36   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/0dc7be081b1c [^]
Maturity status: Test