I have site on drupal 7. I'm creating a module to add a poll on-page instead of a template string.
As I understand, I should do it in some hook-like hook_page_load, hook_init, hook_boot, etc
I created some hooks in my autopolling.module:
<?php
error_log("in autopolling\n",3,'D:\\TEMP\\temp\\php.log');
function autopolling_block_info(){
error_log("autopolling_block_info\n",3,'D:\\TEMP\\temp\\php.log');
$blocks['myblock'] = array(
'info' => t("My custom block"),
);
return $blocks;
}
function autopolling_node_insert($node) {
error_log("autopolling_node_insert\n",3,'D:\\TEMP\\temp\\php.log');
}
function autopolling_insert($node) {
error_log("autopolling_insert\n",3,'D:\\TEMP\\temp\\php.log');
}
function autopolling_page_alter(&$page) {
error_log('autopolling_page_alter',3,'D:\\TEMP\\temp\\php.log');
}
function autopolling_node_load($nodes, $types)
{
error_log("autopolling_node_load\n", 3, 'D:\\TEMP\\temp\\php.log');
}
function autopolling_node_view($entity, $type, $view_mode, $langcode)
{
error_log('autopolling_node_view', 3, 'D:\\TEMP\\temp\\php.log');
}
function autopolling_entity_view($entity, $type, $view_mode, $langcode) {
error_log('autopolling_entity_view',3,'D:\\TEMP\\temp\\php.log');
}
function autopolling_page_build(&$page) {
error_log('autopolling_page_build',3,'D:\\TEMP\\temp\\php.log');
}
function autopolling_init() {
error_log('autopolling_init',3,'D:\\TEMP\\temp\\php.log');
}
function autopolling_boot() {
error_log("autopolling_boot\n",3,'D:\\TEMP\\temp\\php.log');
}
but I've got only "in autopolling" string in my log file (and "autopolling_block_info" if I open admin/structure/block & "autopolling_node_insert" when I add a page).
So, hook_node_load should work, but I've got no record about it. And no records about any other "loading" hook.
I have no errors in drupal journal.
What I'm doing wrong?