Anonymous | Login | Signup for a new account | 2024-04-26 13:30 CDT |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
View Revisions: Issue #43 | [ All Revisions ] [ Back to Issue ] | ||
Summary | 0000043: SWFUploader and "Save" button. | ||
Revision | 2009-06-03 14:31:02 by alex | ||
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. |
||
Revision | 2009-06-03 14:30:25 by alex | ||
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. ---- Besides files, scheduled for deletion for subitems will not be deleted, because of "pending_actions" variable uses <window_id> inside it and most probably subitem edit window <window_id> will differ from main item edit <window_id>. |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Web Development by Intechnic In-Portal Open Source CMS |