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!

Relationship Graph View Issue ] Dependency Graph ]
related to child of duplicate of

Viewing Issue Simple Details
ID Category Type Reproducibility Date Submitted Last Update
0000397 [In-Portal CMS] Data Management task always 2009-10-17 07:00 2012-07-25 05:33
Reporter alex View Status public  
Assigned To alex
Priority normal Resolution fixed  
Status closed      
Summary 0000397: Ability to work with main event from OnBefore/OnAfter type events called from kDBItem class
Description There are two type of events:
1. external events - events, that could be called from outside of the script, by specifying their name in url
2. internal events - events, that are called by internal subroutines only and in most cases are indirectly related to external event being called.

For example OnCreate event is pure external and it allows to create record in database based on form data form request. On the other hand OnBeforeItemCreate is pure internal event, that is called before attempt is made to create database record. This internal event is indirectly called from OnCreate event by calling kDBItem::Create method.

All seems normal at first glance, but in fact it's not. There is no way to access OnCreate event $event object from OnBeforeItemCreate event. One of purposes of such type of access is to change redirect parameters or main event. For example in case of TestField value is equals to 5 we want to redirect user to non-default template after record is successful created.
Additional Information How I see implementation:
1. add 2 methods to kDBItem class: setReferrerEvent(&$event) and removeReferrerEvent()
2. when event of any type is called from kDBItem class (via raiseEvent method), then we set it's MasterEvent attribute to referrer event in case if any was set before.
3. from OnBeforeItemCreate event OnCreate event will be accessed via $event->MasterEvent.



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

Powered by Mantis Bugtracker