Bug 835776 - Uploading the same document via REST and GUI results in two different documents stored.
Uploading the same document via REST and GUI results in two different documen...
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Component-UI (Show other bugs)
1.6
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 1.6.1
Assigned To: Carlos Munoz
Ding-Yi Chen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-27 01:51 EDT by Carlos Munoz
Modified: 2012-07-03 01:27 EDT (History)
1 user (show)

See Also:
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 01:27:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Carlos Munoz 2012-06-27 01:51:25 EDT
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 01:57:04 EDT
    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 01:58:52 EDT
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-01 22:51:03 EDT
VERIFIED with Zanata version 1.6.1-SNAPSHOT (20120702-0014)
Zanata version 1.7-SNAPSHOT (20120702-0025)

Note You need to log in before you can comment on or make changes to this bug.