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!

Viewing Issue Simple Details Jump to Notes ] Wiki ]  Related Changesets ] View Advanced ] Issue History ] Print ]
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 Project Name In-Portal CMS
Assigned To alex Developer
Priority normal Resolution fixed Fixed in Version 5.2.0
Status closed Product Version 5.1.0 Target Version 5.2.0
Time EstimateNo estimate
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.
Tags No tags attached.
Reference https://groups.google.com/d/topic/in-portal-bugs/B-MB2l-Qijw/discussion
Change Log Message Fixes early file upload
Estimate Points 2
Attached Files patch file icon flash_uploader_tmp_folder_fix_513.patch [^] (29,133 bytes) 2012-07-15 14:47 [Show Content]
patch file icon flash_uploader_tmp_folder_fix_520.patch [^] (35,814 bytes) 2012-07-16 05:46 [Show Content]
patch file icon uploader_onafteritemupdate_fix.patch [^] (1,959 bytes) 2012-07-16 11:45 [Show Content]
patch file icon form_manager_and_flash_uploader_fix.patch [^] (448 bytes) 2012-07-19 04:47 [Show Content]
patch file icon subscription_creation_fatal_error_fix.patch [^] (2,090 bytes) 2012-07-24 05:32 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to 0000955closed (5.1.2)alex Strange error, while using flash uploader 
related to 0000870closed (5.1.2)alex Queuing events to uploader fails, when flash object isn't yet loaded 
related to 0000835needs work (Icebox)alex New 5.1.0 style flash uploader porting to Front-End 
related to 0000044closed (5.1.3)alex "Files" are NOT Deleted when Editing Sub-Items 
related to 0001061needs work (Icebox)!COMMUNITY Ability to enter inline description for files in Flash Uploader 
related to 0001068closed (5.1.3)alex Inability to use non-latin characters in flash uploader "Browse" button 
related to 0001355closed (5.2.0)alex Ability to update only given fields via kDBItem::Update method 

-  Notes
User avatar (0002770)
Dmitry (manager)
2010-09-05 20:59

Is this still active? I believe by today we have changed Uploder quite a bit.
User avatar (0002772)
alex (manager)
2010-09-06 05:30

Yes, it's active. I supposed, that the answer was obvious to you, since you've tested all that tasks, that changed an uploader.
User avatar (0002777)
Dmitry (manager)
2010-09-06 11:33

Reminder sent to: alex

Yeah, you are right - I must read the whole task before asking. Now I see that issue is still active and needs to be addressed.

Thanks.
User avatar (0004779)
alex (manager)
2012-07-15 15:16

What was done:
1. info about all uploaded/deleted, both temp and live, files is stored in session
2. when user deletes file that he just uploaded (before saving changes to db), then file was always deleted from live folder (and not temp one as it should).
User avatar (0004780)
alex (manager)
2012-07-16 05:35

Will test all together later.
User avatar (0004781)
alex (manager)
2012-07-16 05:53

Fix committed to 5.2.x branch. Commit Message:

Fixes 0000043: SWFUploader and "Save" button.
User avatar (0004790)
alex (manager)
2012-07-16 11:47

Patch "uploader_onafteritemupdate_fix.patch" along with 0001355 task solves problem with kDBItem changed fields not being detected in OnAfterItemUpdate event.
User avatar (0004808)
alex (manager)
2012-07-19 04:48

In this task I've changed what hidden fields are used to transfer uploaded file into back to server and "tmp_names" hidden field no longer exists.

JavaScript class FormManager, who used it also stopped working because of that. Fix for it is attached in "form_manager_and_flash_uploader_fix.patch" patch.
User avatar (0004819)
alex (manager)
2012-07-24 05:33

Patch "subscription_creation_fatal_error_fix.patch" fixes problem when after creation of subscription-type product SQL error ending with "...ItemResourceId=)..." was thrown.
User avatar (0004820)
alex (manager)
2012-07-25 05:29

Since 5.2.0 version was released.

- Related Changesets
In-Portal CMS: 5.2.x r15474
Timestamp: 2012-07-24 05:34:36
Author: alex
Details ] Diff ]
Bug 0000043: SWFUploader and "Save" button.
1. Fixes problem with create new subscription-type product
mod - /in-portal/branches/5.2.x/core/kernel/db/db_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/db/dbitem.php Diff ] File ]
Themes :: Modern-Store: 1.0.x r15463
Timestamp: 2012-07-19 04:48:47
Author: alex
Details ] Diff ]
Bug 0000043: SWFUploader and "Save" button.
mod - /themes/modern-store/branches/1.0.x/inc/js/form_manager.js Diff ] File ]
In-Portal CMS: 5.2.x r15455
Timestamp: 2012-07-16 11:47:53
Author: alex
Details ] Diff ]
Bug 0000043: SWFUploader and "Save" button.
1. problem with OnAfterItemUpdate event
mod - /in-portal/branches/5.2.x/core/kernel/db/dbitem.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/utility/formatters/upload_formatter.php Diff ] File ]
In-Portal CMS: 5.2.x r15446
Timestamp: 2012-07-16 05:53:54
Author: alex
Details ] Diff ]
Fixes 0000043: SWFUploader and "Save" button.
mod - /in-portal/branches/5.2.x/core/admin_templates/incs/form_blocks.tpl Diff ] File ]
mod - /in-portal/branches/5.2.x/core/admin_templates/js/uploader/upload_manager.js Diff ] File ]
mod - /in-portal/branches/5.2.x/core/admin_templates/js/uploader/uploader.js Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/db/db_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/db/dbitem.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/utility/formatters/upload_formatter.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2012-07-25 05:29 alex Note Added: 0004820
2012-07-25 05:29 alex Status resolved => closed
2012-07-24 05:34 alex Changeset attached 5.2.x r15474
2012-07-24 05:33 alex Note Added: 0004819
2012-07-24 05:32 alex File Added: subscription_creation_fatal_error_fix.patch
2012-07-19 04:59 alex Relationship added related to 0000835
2012-07-19 04:48 alex Changeset attached 1.0.x r15463
2012-07-19 04:48 alex Note Added: 0004808
2012-07-19 04:47 alex File Added: form_manager_and_flash_uploader_fix.patch
2012-07-16 11:47 alex Changeset attached 5.2.x r15455
2012-07-16 11:47 alex Note Added: 0004790
2012-07-16 11:45 alex File Added: uploader_onafteritemupdate_fix.patch
2012-07-16 11:38 alex Relationship added related to 0001355
2012-07-16 05:53 alex Note Added: 0004781
2012-07-16 05:53 alex Status reviewed and tested => resolved
2012-07-16 05:53 alex Fixed in Version => 5.2.0
2012-07-16 05:53 alex Resolution open => fixed
2012-07-16 05:53 alex Assigned To !COMMUNITY => alex
2012-07-16 05:53 alex Changeset attached 5.2.x r15446
2012-07-16 05:46 alex File Added: flash_uploader_tmp_folder_fix_520.patch
2012-07-16 05:45 alex File Deleted: flash_uploader_tmp_folder_fix_520.patch
2012-07-16 05:35 alex Note Added: 0004780
2012-07-16 05:35 alex Status needs testing => reviewed and tested
2012-07-16 05:34 alex Target Version Icebox => 5.2.0
2012-07-15 15:16 alex Note Added: 0004779
2012-07-15 15:16 alex Assigned To alex => !COMMUNITY
2012-07-15 15:16 alex Developer => alex
2012-07-15 15:16 alex Status needs work => needs testing
2012-07-15 14:50 alex File Added: flash_uploader_tmp_folder_fix_520.patch
2012-07-15 14:47 alex File Added: flash_uploader_tmp_folder_fix_513.patch
2012-07-15 14:47 alex Note Deleted: 0004778
2012-07-15 14:47 alex File Deleted: flash_uploader_tmp_folder_fix_513.patch
2012-07-15 13:36 alex Note Added: 0004778
2012-07-15 05:59 alex File Added: flash_uploader_tmp_folder_fix_513.patch
2012-07-11 14:30 alex Reference => https://groups.google.com/d/topic/in-portal-bugs/B-MB2l-Qijw/discussion
2012-07-11 14:30 alex Change Log Message => Fixes early file upload
2012-07-11 14:30 alex Estimate Points => 2
2012-01-11 08:11 alex Relationship added related to 0000870
2012-01-11 08:10 alex Relationship added related to 0000955
2011-05-28 15:07 alex Relationship added related to 0001068
2011-05-28 14:55 alex Relationship added related to 0001061
2010-12-06 12:34 alex Relationship added related to 0000044
2010-09-06 11:33 Dmitry Note Added: 0002777
2010-09-06 05:30 alex Note Added: 0002772
2010-09-06 05:30 alex Status needs feedback => needs work
2010-09-05 20:59 Dmitry Note Added: 0002770
2010-09-05 20:59 Dmitry Status needs work => needs feedback
2010-08-31 14:25 alex Status active => needs work
2010-08-31 14:25 alex version => 5.1.0
2009-10-03 07:54 administrator Status reviewed and tested => active
2009-09-20 15:17 alex Target Version 5.1.0 => Icebox
2009-08-03 15:53 Dmitry Assigned To => alex
2009-08-03 15:53 Dmitry Status active => reviewed and tested
2009-08-03 15:53 Dmitry Target Version 5.0.1 => 5.1.0
2009-06-07 06:39 alex Reproducibility @70@ => always
2009-06-06 23:13 Dmitry Target Version => 5.0.1
2009-06-03 14:31 alex Additional Information Updated View Revisions
2009-06-03 14:30 alex New Issue



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

Powered by Mantis Bugtracker