Bug 835776

Summary: Uploading the same document via REST and GUI results in two different documents stored.
Product: [Retired] Zanata Reporter: Carlos Munoz <camunoz>
Component: Component-UIAssignee: Carlos Munoz <camunoz>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.6CC: zanata-bugs
Target Milestone: ---   
Target Release: 1.6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 1.6.1-SNAPSHOT (20120702-0014) Doc Type: Bug Fix
Doc Text:
Cause Uploading the a document via the REST API and then attempting to upload the same document via the GUI providing the same path with the addition of a leading slash ('/'). Consequence Zanata uploads two documents, one for a path with a leading slash and another with no slash. Fix The GUI now strips all leading slashes form the provided path when uploading. Result Uploading the same document from the GUI and REST should result in a single document in Zanata even if the GUI provided path has more a leading slash.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-03 05:27:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Carlos Munoz 2012-06-27 05:51:25 UTC
Description of problem:
When uploading the same document first via the REST Api and then via the GUI


Version-Release number of selected component (if applicable):


How reproducible:
always


Steps to Reproduce:
1. Upload a document using the GUI, and be sure to provide a path starting with a '/'.
2. Upload the same document using the REST API (python or maven client), and make sure it resides under the same path as the document in step 1.
  
Actual results:
The same document will be uploaded twice with a path leading with a '/' and the same path without the leading '/'.


Expected results:
Zanata should upload the same document both times.

Comment 1 Carlos Munoz 2012-06-27 05:57:04 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
Uploading the a document via the REST API and then attempting to upload the same document via the GUI providing the same path with the addition of a leading slash ('/').

Consequence
Zanata uploads two documents, one for a path with a leading slash and another with no slash.

Fix
The GUI now strips all leading slashes form the provided path when uploading.

Result
Uploading the same document from the GUI and REST should result in a single document in Zanata even if the GUI provided path has more a leading slash.

Comment 2 Carlos Munoz 2012-06-27 05:58:52 UTC
Removing all leading slashes from paths when uploading documents from the GUI. Aslo making sure a trailing slash is on the path when necessary.

See:
http://github.com/zanata/zanata/commit/a7937c6cce66b6345974a9ee0d1cd49b9c8c670c

Comment 3 Ding-Yi Chen 2012-07-02 02:51:03 UTC
VERIFIED with Zanata version 1.6.1-SNAPSHOT (20120702-0014)
Zanata version 1.7-SNAPSHOT (20120702-0025)