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
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
core/kernel/db/db_event_handler.php | ||
---|---|---|
1768–1776 ↗ | (On Diff #1328) | Please:
usage of the ids $event parameter is internal logic of this method and should not be exposed to whoever calls it |
1778 ↗ | (On Diff #1328) | Add this code above the selected line: $event->setEventParam('ids', $ids); See above. |
1781 ↗ | (On Diff #1328) | please exit from the method using inverted condition IF ends at the same time, when the method ends |
1875–1886 ↗ | (On Diff #1328) | Please use deleteByEventIDs method in this (the OnMassDelete) event as well. Code of the deleteByEventIDs method mostly duplicates the selected code. |
1888 ↗ | (On Diff #1328) | Please also move this line after the $ids = $this->StoreSelectedIDs($event); line. |