In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
890 [In-Portal CMS] Data Management bug report always 2010-10-19 03:36 2010-11-30 12:48
alex  
alex  
normal  
closed 5.1.1-B1  
fixed  
 
none 5.1.1-B2  
http://groups.google.com/group/in-portal-bugs/browse_thread/thread/3c4845108f351772
0
0000890: Event "OnAfterItemDelete" isn't called, when cateogry item is delted to "Recycle Bin"
There is a nice feature in In-Portal, called "Recycle Bin" (off by default). To use it you:
1. must create a category/section somewhere
2. specify created category/section in appropriate configuration variable (RecycleBinFolder)

Then if you will delete any categories or category items in catalog (in admin console only), then they will be moved to that "Recycle Bin" category instead of actually being delted.

This is good, but from developer point of view he assumes, that when administrator click on "Delete" button on toolbar, then at the end something should be deleted. When "Recycle Bin" feature is used, then nothing is deleted.

To solve such a problem I propose to call OnAfterItemDelete event (which happens after item is deleted) in case, when category item is moved to "Recycle Bin".
patch emulate_onafteritemdelete_when_recyclebin_used.patch (813) 2010-10-19 03:36
http://tracker.in-portal.org/file_download.php?file_id=812&type=bug
Issue History
2010-11-30 12:48 Dmitry Note Added: 0003012
2010-11-30 12:48 Dmitry Status resolved => closed
2010-10-19 14:16 alex Changeset attached 5.1.x r14002
2010-10-19 14:16 alex Note Added: 0002915
2010-10-19 14:16 alex Status reviewed and tested => resolved
2010-10-19 14:16 alex Fixed in Version => 5.1.1-B2
2010-10-19 14:16 alex Resolution open => fixed
2010-10-19 14:16 alex Assigned To !COMMUNITY => alex
2010-10-19 11:57 Dmitry Note Added: 0002911
2010-10-19 11:57 Dmitry Status needs testing => reviewed and tested
2010-10-19 03:38 alex Note Added: 0002891
2010-10-19 03:37 alex Assigned To => !COMMUNITY
2010-10-19 03:37 alex Developer => alex
2010-10-19 03:37 alex Status active => needs testing
2010-10-19 03:37 alex Reference => http://groups.google.com/group/in-portal-bugs/browse_thread/thread/3c4845108f351772
2010-10-19 03:36 alex New Issue
2010-10-19 03:36 alex File Added: emulate_onafteritemdelete_when_recyclebin_used.patch

Notes
(0002891)
alex   
2010-10-19 03:38   
Maybe we can delete that 2nd:
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
code, since I suppose that object is recalled somewhere in that method already.
(0002911)
Dmitry   
2010-10-19 11:57   
1. Reviewed and tested okay, but please add $this->Application->isAdminUser to:

if ($recycle_bin) {

since this only good for Admin actions.


2. I would keep:

$object =& $event->getObject();
/* @var $object kCatDBItem */

since it's used for the Front-end event only.

Please commit.
(0002915)
alex   
2010-10-19 14:16   
Fix committed to 5.1.x branch. Commit Message:

Fixes 0000890: Event "OnAfterItemDelete" isn't called, when cateogry item is delted to "Recycle Bin"
(0003012)
Dmitry   
2010-11-30 12:48   
Closing released 5.1.1 task.