I'm working on an auto-expiration cron hook to automatically roll-back the changes made for services ordered in the CART program and I'm running into some strangeness... not sure if it's intentional or not, but here's what I'm seeing.
I have a hook called "cart_get_catalog" and a global function by the same name. The function is pretty simple:
function cart_get_catalog($filtered=true) {
$items=Array();
call_hooks('cart_get_catalog',$items);
if ($filtered) {
call_hooks('cart_filter_catalog_display',$items);
}
return $items;
}
There are registered hooks in 3 separate files with the name "cart_get_catalog" which seem to fire and properly populate the catalog when using the Web UI. But when kicked off by running
Zotlabs/Daemon/Master.php Cron
only one of the three "cart_get_catalog" hooks runs. The one that runs happens to be in the same file as the CRON hook. The call to the function "cart_get_catalog" sets filtered to false, so the list should not be filtered.
Based on how the hooks are registered and stored in the database, it seems to me that the other files with this hook should automatically be loaded and the hooks should fire. Am I missing something?
I haven't trudged through the code - but is what I'm seeing expected behavior? Or should all the hooks actually fire?
@
Mike Macgirvin @
Mario Vavti @
Andrew Manning