Datastore Conversion
Jamroom Developers
Any database adjustments or updates usually fire off of the integrity check listeners
ACP -> MODULES -> CORE -> SYSTEM CORE -> TOOLS -> INTEGRITY CHECK
So probably the 'repair_module' listener.
Then in there whatever adjustments that need to be done are done. Example, the Gallery Module needed to make sure that all datastore items have a 'gallery_order' value set, so does this in the repair module listener:
function jrGallery_repair_module_listener($_data, $_user, $_conf, $_args, $event)
{
$_rt = jrCore_db_get_items_missing_key('jrGallery', 'gallery_order');
if ($_rt && is_array($_rt)) {
$_up = array();
foreach ($_rt as $id) {
$_up[$id] = array('gallery_order' => 100);
}
if (count($_up) > 0) {
jrCore_db_update_multiple_items('jrGallery', $_up);
jrCore_logger('INF', "updated " . count($_up) . " gallery images missing gallery_order key");
}
}
return $_data;
}
* get all gallery items missing the 'gallery_order' key.
* set that items 'gallery_order' key to 100
* update all those items.