Code Review: Bug Fix - Database Entry gets created even if Document Upload failed

yehster wrote on Monday, May 20, 2013:

When uploading documents, if the upload fails (for example because there is a permissions problem), then the entry in the Documents table was still erroneously being created.

This commit makes it so that the entry is no longer created.

To reproduce on Ubuntu:
change permissions/owner of sites/default/documents to something other than www-data
Choose a patient and upload a document.
Server responds with error message: “The file could not be succesfully stored, this error is usually related to permissions problems on the storage system”
However a new entry pointing to a non-existent document gets created in the tree.

After this change, the same error message gets reported, but no change to the documents tree is made.

The commit also includes whitespace changes. (tabs changed to spaces).

bradymiller wrote on Friday, May 24, 2013:

Hi,
Seems straightforward. If testing fine, rec bringing it into sourceforge.
-brady
OpenEMR