Hook entity insert (Drupal): verschil tussen versies
Naar navigatie springen
Naar zoeken springen
(→Casus) |
|||
Regel 69: | Regel 69: | ||
} | } | ||
</pre> | </pre> | ||
+ | |||
+ | == Probleem == | ||
+ | |||
+ | De meeste van bovenstaande events vinden niet plaats | ||
+ | |||
+ | {| | ||
+ | |[[file:20161203-1654.png|thumb|Een nieuw artikel aangemaakt. Event vindt niet plaats]] | ||
+ | |} | ||
+ | |||
== Syntaxis == | == Syntaxis == | ||
Versie van 3 dec 2016 15:55
hook_entity_insert is een generieke hook die voor alles en nog wat handig is, bv. als een nieuwe order in Drupal Commerce is ingegeven (omdat er geen specifieker event bestaat). Vooralsnog krijg ik 'm alleen niet aan de praat
Casus
Om 'm te testen gebruik ik deze code:
// entity_insert ///////////////////////////////////////////// // function commerce_adwords_entity_insert($entity, $type) { print "<br><br><br> entity_insert"; print phpinfo(); } // Overige events ///////////////////////////////////////////// // function commerce_adwords_commerce_order_presave($order) { print "<br><br><br> commerce_order_presave"; // print phpinfo(); } function commerce_adwords_order_state_info() { print "<br><br><br> commerce_adwords_commerce_order_presave - Sla nieuwe order op "; // print phpinfo(); } function commerce_adwords_entity_presave() { print "<br><br><br> entity_presave"; // print phpinfo(); } function commerce_adwords_entity_update($entity, $type) { print "<br><br><br> entity_update"; // print phpinfo(); } function commerce_adwords_commerce_order_status_update() { print "<br><br><br> commerce_order_status_update"; // print phpinfo(); } function commerce_adwords_commerce_order_status_info() { print "<br><br><br> commerce_order_status_info"; // print phpinfo(); } function commerce_adwords_commerce_checkout_complete() { print "<br><br><br> commerce_checkout_complete"; // print phpinfo(); } function commerce_adwords_init() { if (arg(0)=='checkout' && arg(2)=='complete') { print "<br><br><br> commerce_adwords_init - checkout-completed-page<br>"; } }
Probleem
De meeste van bovenstaande events vinden niet plaats