Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
Since field and widget infos are cached, if your module adds a field or a widget, you need a .install file similar to the one below too. It's not needed if you just add formatters.
Also, if you add or update a field (hook_field_info) or a widget (hook_widget_info), you need to have an update function like below.
// $Id:$
/**
* @file
* Implementation of hook_install().
*/
function modulename_install() {
drupal_load('module', 'content');
content_notify('install', 'modulename');
}
/**
* Implementation of hook_uninstall().
*/
function modulename_uninstall() {
drupal_load('module', 'content');
content_notify('uninstall', 'modulename');
}
/**
* Implementation of hook_enable().
*
* Notify content module when this module is enabled.
*/
function modulename_enable() {
drupal_load('module', 'content');
content_notify('enable', 'modulename');
}
/**
* Implementation of hook_disable().
*
* Notify content module when this module is disabled.
*/
function modulename_disable() {
drupal_load('module', 'content');
content_notify('disable', 'modulename');
}
/**
* uncomment update function if fields (hook_field_info) or widgets (hook_widget_info) are added or changed
*/
/*
function modulename_update_6000() {
drupal_load('module', 'content');
drupal_load('module', 'modulename');
content_notify('install', 'modulename');
content_notify('enable', 'modulename');
return array();
}
*/
Comments
Thanks for your hints! One
Thanks for your hints!
But one question:
Should i call the content_notify-functions after my hook did some changes or before?