In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
614 [In-Portal CMS] Data Management feature request always 2010-03-14 14:46 2010-07-22 15:06
alex  
alex  
normal  
closed 5.0.2  
fixed  
 
none 5.1.0-B1  
http://groups.google.com/group/in-portal-dev/browse_thread/thread/7f1644d3dff4ecd4
Ability to load an Object from hash fields
0
0000614: Ability to load kDBItem class object from hash
Hi, I think, that we should add LoadFromHash (or something similar) method to kDBItem class. This method will allow use to simulate actual Load method, but data will be retrieved from given field set and not from database. This is not just call of SetDBFieldsFromHash as it might seem. Such method also calls OnBefore/OnAfter events and sets original field values and item ID. This method could be useful during import operations.
related to 0000642closed  (5.0.4)alex In-Commerce Notice about undefined field "File5" on product update 
related to 0000472closed  (5.1.0)alex In-Portal CMS Domain-based site auto-configuration 
related to 0000907closed  (5.1.3)alex In-Bulletin Tag "bb-post_PosterField" doesn't work with custom fields 
patch load_item_from_hash.patch (873) 2010-03-14 14:46
http://tracker.in-portal.org/file_download.php?file_id=359&type=bug
patch load_item_from_hash_v2.patch (1,053) 2010-05-01 08:15
http://tracker.in-portal.org/file_download.php?file_id=505&type=bug
Issue History
2011-05-23 02:45 alex Relationship added related to 0000907
2010-07-22 15:06 alex Note Added: 0002537
2010-07-22 15:06 alex Status resolved => closed
2010-05-01 11:17 alex Note Added: 0002033
2010-05-01 11:17 alex Status reviewed and tested => resolved
2010-05-01 11:17 alex Fixed in Version => 5.1.0-B1
2010-05-01 11:17 alex Resolution open => fixed
2010-05-01 11:17 alex Changeset attached 5.1.x r13474
2010-05-01 10:03 Dmitry Change Log Message => Ability to load an Object from hash fields
2010-05-01 10:03 Dmitry Type bug report => feature request
2010-05-01 10:01 Dmitry Note Added: 0002032
2010-05-01 10:01 Dmitry Assigned To !COMMUNITY => alex
2010-05-01 10:01 Dmitry Status needs testing => reviewed and tested
2010-05-01 08:17 alex Note Added: 0002031
2010-05-01 08:17 alex Assigned To alex => !COMMUNITY
2010-05-01 08:17 alex Status needs work => needs testing
2010-05-01 08:16 alex Note Added: 0002030
2010-05-01 08:16 alex Assigned To !COMMUNITY => alex
2010-05-01 08:16 alex Status reviewed and tested => needs work
2010-05-01 08:15 alex File Added: load_item_from_hash_v2.patch
2010-05-01 08:00 alex Note Added: 0002029
2010-05-01 08:00 alex Target Version Icebox => 5.1.0
2010-05-01 07:59 alex Relationship added related to 0000472
2010-04-04 18:23 Dmitry Note Added: 0001779
2010-04-04 18:23 Dmitry Status needs testing => reviewed and tested
2010-03-26 03:02 alex Relationship added related to 0000642
2010-03-14 16:02 alex Note Added: 0001597
2010-03-14 15:42 Dmitry Note Added: 0001596
2010-03-14 14:46 alex Assigned To => !COMMUNITY
2010-03-14 14:46 alex Developer => alex
2010-03-14 14:46 alex Status active => needs testing
2010-03-14 14:46 alex New Issue
2010-03-14 14:46 alex File Added: load_item_from_hash.patch
2010-03-14 14:46 alex Reference => http://groups.google.com/group/in-portal-dev/browse_thread/thread/7f1644d3dff4ecd4

Notes
(0001596)
Dmitry   
2010-03-14 15:42   
Reminder sent to: alex

Hi Alex,


Would you please post a quick test scenario here. I guess we would need too imitate this part?


DA
(0001597)
alex   
2010-03-14 16:02   
Here testing code:

$normal_object =& $this->Application->recallObject('widget', null, Array ('skip_autoload' => true));
$normal_object->Load(5);

$improvised_object =& $this->Application->recallObject('widget', null, Array ('skip_autoload' => true));
$improvised_object->LoadFromHash( $normal_object->GetFieldValues() );

As the result both object should look same inside.
(0001779)
Dmitry   
2010-04-04 18:23   
Patch tested Good!
(0002029)
alex   
2010-05-01 08:00   
Moving to 5.1.0 since needed by Site Domain functionality (task: 0000472)
(0002030)
alex   
2010-05-01 08:16   
Problems found:
1. Doesn't process cases, when load could fail
2. Doesn't return true on successful load
(0002031)
alex   
2010-05-01 08:17   
Problems, described in comment above fixed. Please test.
(0002032)
Dmitry   
2010-05-01 10:01   
Tested good on 5.1.0.

Please commit.
(0002033)
alex   
2010-05-01 11:17   
Fix committed to 5.1.x branch. Commit Message:

Fixes 0000614: Ability to load kDBItem class object from hash
(0002537)
alex   
2010-07-22 15:06   
Closing, since 5.1.0 release has been released.