In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Relationship Graph View Issue ] Dependency Graph ]
related to child of duplicate of

Viewing Issue Simple Details
ID Category Type Reproducibility Date Submitted Last Update
0000043 [In-Portal CMS] Admin Interfaces bug report always 2009-06-03 14:30 2012-07-25 05:29
Reporter alex View Status public  
Assigned To alex
Priority normal Resolution fixed  
Status closed      
Summary 0000043: SWFUploader and "Save" button.
Description When "inp_edit_swfupload" block is used on form, then selected files are actually uploaded in two cases:
1. when "upload" button is pressed (under uploader control)
2. when "save" button is pressed (on top of form)

By default SWFUploader uploads files in temp directory ("/system/tmp") and when saving record to database ("save" button pressed) is moving uploaded files from temp directory to actual directory, specified in unit config.

But, when we have some invalid data on form, like required field value is not entered and "save" button is pressed, then we are returned to form with validation errors displayed, but are already uploaded to target directory.

Files, uploaded to temp directory should only be moved to target directory when "save" button is pressed and there are not validation errors on form.
Additional Information This is what happens in what order:
1. OnSave event is called.
2. withing OnSave event method "kDBItem::SetFieldsFromHash" is called
3. method "kDBItem::SetFieldsFromHash" calls "kUploadFormatter::Parse" method
Last of mentioned methods actually performs file moving from temp directory to target directory.

And only after that form validation happens when "OnPreSave" event is called.

So Parse method actually doesn't know anything about validation result, because no validation happened at that moment.

Instead of actually moving files I propose to put moving operations to "<prefix_special>_pending_actions_<m_wid>" variable (it is kind of queue).

Queue processing should be made in OnSave event (when temporary tables are used) and in OnAfterItemUpdate/OnAfterItemCreate (when temporary tables are not used).

----

By no "pending_actions" variable is used only to schedule uploaded file deletion operation. This processing should be joined with file moving and centrally processed in one place.



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker