Anonymous | Login | Signup for a new account | 2024-05-02 20:06 CDT |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Dependency Graph | [ View Issue ] [ Relation Graph ] [ Horizontal ] | |||
|
||||
|
Viewing Issue Simple Details | |||||
ID | Category | Type | Reproducibility | Date Submitted | Last Update |
0000398 | [In-Portal CMS] Optimization | task | always | 2009-10-17 07:12 | 2012-07-25 05:32 |
Reporter | alex | View Status | public | ||
Assigned To | alex | ||||
Priority | normal | Resolution | fixed | ||
Status | closed | ||||
Summary | 0000398: Partially move kCatDBItem and CreategoryItem class contents to OnBefore/OnAfter events | ||||
Description |
Classes kCatDBItem and CreategoryItem were created before OnBefore/OnAfter events were invented. That's why most of their code is not located in them, as it should. When OnBefore/OnAfter events are used with that classes, then it in most cases lead to unpredictable behavior and hardly detectable processing logic errors. For example you expect, that OnAfterItemCreate is called after category item is created. But it happens in the middle and after it's called category item is assigned to primary category. Created category item (in state available in OnAfterItemCreate event) won't be able to load at all, because it JOINed to CategoryItems table, where record is not present at the moment. How this happens now: 1. kCatDBItem::Create() 2. kCatDBEventHandler::OnAfterItemCreate(&$event) 3. kCatDBItem::assignPrimaryCategory() 4. kCatDBItem::Update() 5. kCatDBEventHandler::OnAfterItemUpdate(&$event) How this should happen: 1. kCatDBItem::Create() 2. kCatDBItem::assignPrimaryCategory() 3. kCatDBItem::Update() 4. kCatDBEventHandler::OnAfterItemUpdate(&$event) 6. kCatDBEventHandler::OnAfterItemCreate(&$event) Because what's the point of OnAfter event if it's called in the middle and not at the end. Because of that there is no way to control what code (customized or original) will go first. |
||||
Additional Information |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Web Development by Intechnic In-Portal Open Source CMS |