ensured customProcessing call for OnDelete and OnDeleteAll events
Details
Details
Preparations
Put following code as the kDBEventHandler::customProcessing method body.
if ( $event->Name == 'OnDelete' && $type == 'before' ) { trigger_error('OnDelete custom processing', E_USER_NOTICE); } if ( $event->Name == 'OnDeleteAll' && $type == 'before' ) { trigger_error('OnDeleteAll custom processing', E_USER_NOTICE); } if ( $event->Name == 'OnMassDelete' && $type == 'before' ) { trigger_error('OnMassDelete custom processing', E_USER_NOTICE); }
Testing
- login to the adm. console, ensure that front-end theme "advanced" is default theme
 - go to the User Management → Users section, create some regular user
 - select some regular user in the Users grid and press "Login As"
 - on front-end click on "My Addresses" link in the left side-box
 - in the "My Addresses" section click on "New Address" link, create some address
 - in the "My Addresses" press on "Delete" link
 - in the adm. console go to the Logs & Reports → E-mail Log section
 - press "Delete All" button in the section toolbar, confirm items deletion, asked in js alert
 - go to the Configuration → Website → Stop Words section, select and delete some records from "Stop Words" grid
 - go to the Logs & Reports → System Log section, confirm, that just created records with messages "OnDeleteAll custom processing", "OnMassDelete custom processing" and "OnDelete custom processing"
 
Diff Detail
Diff Detail
- Repository
 - rINP In-Portal
 - Branch
 - branches/5.2.x
 - Lint
 Lint OK - Unit
 No Unit Test Coverage - Build Status
 Buildable 11080 Build 3780: arc lint + arc unit 
Event Timeline
| core/kernel/db/db_event_handler.php | ||
|---|---|---|
| 1763–1764 | please exit from the method using inverted condition IF ends at the same time, when the method ends  | |
| 1768–1776 | Please: 
 usage of the ids $event parameter is internal logic of this method and should not be exposed to whoever calls it  | |
| 1778 | Add this code above the selected line: $event->setEventParam('ids', $ids); See above.  | |
| 1847–1873 | Please use deleteByEventIDs method in this (the OnMassDelete) event as well. Code of the deleteByEventIDs method mostly duplicates the selected code.  | |
| 1875–1882 | Please also move this line after the $ids = $this->StoreSelectedIDs($event); line.  | |