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!

Viewing Issue Advanced Details Jump to Notes ] Wiki ]  Related Changesets ] View Simple ] Issue History ] Print ]
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 Project Name In-Portal CMS
Assigned To alex Developer
Priority normal Resolution fixed Platform
Status closed   OS
  OS Version
ETA none Fixed in Version 5.2.0-B1 Product Version 5.0.1
  Target Version 5.2.0 Product Build
Time EstimateNo estimate
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.
Steps To Reproduce
Additional Information
Tags No tags attached.
Reference
Change Log Message
Estimate Points 1
Attached Files patch file icon category_item_optimization.patch [^] (13,857 bytes) 2011-11-01 11:04 [Show Content]
png file icon 2011-11-04_2053.png [^] (269,099 bytes) 2011-11-07 03:57
patch file icon category_pasting_produced_sql_error.patch [^] (1,426 bytes) 2011-11-07 03:57 [Show Content]
patch file icon duplicate_category_resourceid_on_import_v2.patch [^] (1,471 bytes) 2011-12-30 06:09 [Show Content]
png file icon ProductImportCategoryIssue.png [^] (64,964 bytes) 2011-12-30 06:12

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
User avatar (0004113)
alex (manager)
2011-11-01 11:04

Will test all later together.
User avatar (0004114)
alex (manager)
2011-11-01 11:12

Fix committed to 5.2.x branch. Commit Message:

Fixes 0000398: Partially move kCatDBItem and CreategoryItem class contents to OnBefore/OnAfter events
User avatar (0004136)
alex (manager)
2011-11-07 03:59
edited on: 2011-11-07 04:01

Patch "category_pasting_produced_sql_error.patch" fixes problem with category/category item copy/paste problem seen on "2011-11-04_2053.png" attachment.

Problem was produced by commit in this task (ResourceId field not being reset before category/category item is cloned).

User avatar (0004363)
alex (manager)
2011-12-30 06:12

Patch "duplicate_category_resourceid_on_import_v2.patch" solves the problem when categories on multiple deep levels were specified in product import file, that resulted category ResourceId field to be non-unique during import (e.g. 'CategoryA||CategoryB' (see ProductImportCategoryIssue.png image, provided by Dmitry).
User avatar (0005010)
alex (manager)
2012-07-25 05:32

Since 5.2.0 version was released.

- Related Changesets
In-Portal CMS: 5.2.x r14959
Timestamp: 2011-12-30 06:13:13
Author: alex
Details ] Diff ]
Bug 0000398: Partially move kCatDBItem and CreategoryItem class contents to OnBefore/OnAfter events
1. fixes duplicate ResourceId on product import that has 2+ levels in category structure
mod - /in-portal/branches/5.2.x/core/units/helpers/cat_dbitem_export_helper.php Diff ] File ]
In-Portal CMS: 5.2.x r14736
Timestamp: 2011-11-07 04:00:36
Author: alex
Details ] Diff ]
Bug 0000398: Partially move kCatDBItem and CreategoryItem class contents to OnBefore/OnAfter events
1. fixing problem with ResourceId field not being reset before category/category item is cloned
mod - /in-portal/branches/5.2.x/core/kernel/db/cat_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/categories/categories_event_handler.php Diff ] File ]
In-Portal CMS: 5.2.x r14719
Timestamp: 2011-11-01 11:12:02
Author: alex
Details ] Diff ]
Fixes 0000398: Partially move kCatDBItem and CreategoryItem class contents to OnBefore/OnAfter events
mod - /in-portal/branches/5.2.x/core/kernel/db/cat_dbitem.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/kernel/db/cat_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/categories/categories_event_handler.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/categories/categories_item.php Diff ] File ]
mod - /in-portal/branches/5.2.x/core/units/users/users_event_handler.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2012-07-25 05:32 alex Note Added: 0005010
2012-07-25 05:32 alex Status resolved => closed
2011-12-30 06:13 alex Changeset attached 5.2.x r14959
2011-12-30 06:12 alex File Added: ProductImportCategoryIssue.png
2011-12-30 06:12 alex Note Added: 0004363
2011-12-30 06:09 alex File Added: duplicate_category_resourceid_on_import_v2.patch
2011-11-07 04:01 alex Note Edited: 0004136 View Revisions
2011-11-07 04:00 alex Changeset attached 5.2.x r14736
2011-11-07 03:59 alex Note Added: 0004136
2011-11-07 03:57 alex File Added: category_pasting_produced_sql_error.patch
2011-11-07 03:57 alex File Added: 2011-11-04_2053.png
2011-11-01 11:12 alex Note Added: 0004114
2011-11-01 11:12 alex Status reviewed and tested => resolved
2011-11-01 11:12 alex Fixed in Version => 5.2.0-B1
2011-11-01 11:12 alex Resolution open => fixed
2011-11-01 11:12 alex Assigned To !COMMUNITY => alex
2011-11-01 11:12 alex Changeset attached 5.2.x r14719
2011-11-01 11:04 alex Status needs testing => reviewed and tested
2011-11-01 11:04 alex Note Added: 0004113
2011-11-01 11:04 alex Time Estimate Removed 2 =>
2011-11-01 11:04 alex Assigned To alex => !COMMUNITY
2011-11-01 11:04 alex Developer => alex
2011-11-01 11:04 alex Status needs work => needs testing
2011-11-01 11:04 alex File Added: category_item_optimization.patch
2011-10-22 05:37 alex Estimate Points => 1
2011-09-27 05:08 alex Time Estimate Added 2
2011-09-23 21:57 Dmitry Target Version Icebox => 5.2.0
2009-11-25 01:22 Dmitry Assigned To => alex
2009-11-25 01:22 Dmitry Status active => needs work
2009-10-17 07:12 alex Target Version => Icebox
2009-10-17 07:12 alex New Issue



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

Powered by Mantis Bugtracker