Commit 9b19f675 authored by Matthias Hutterer's avatar Matthias Hutterer
Browse files

adding content_check_update to update function

parent b3dd8e42
<?php <?php
// Updates happen in random order, whether or not the module is enabled,
// so include critical code here just to be sure.
include_once(drupal_get_path('module', 'content') .'/content.module');
/** /**
* Implementation of hook_install(). * Implementation of hook_install().
*/ */
function email_install() { function email_install() {
drupal_load('module', 'content');
content_notify('install', 'email'); content_notify('install', 'email');
} }
...@@ -15,6 +13,7 @@ function email_install() { ...@@ -15,6 +13,7 @@ function email_install() {
* Implementation of hook_uninstall(). * Implementation of hook_uninstall().
*/ */
function email_uninstall() { function email_uninstall() {
drupal_load('module', 'content');
content_notify('uninstall', 'email'); content_notify('uninstall', 'email');
} }
...@@ -24,6 +23,7 @@ function email_uninstall() { ...@@ -24,6 +23,7 @@ function email_uninstall() {
* Notify content module when this module is enabled. * Notify content module when this module is enabled.
*/ */
function email_enable() { function email_enable() {
drupal_load('module', 'content');
content_notify('enable', 'email'); content_notify('enable', 'email');
} }
...@@ -33,6 +33,7 @@ function email_enable() { ...@@ -33,6 +33,7 @@ function email_enable() {
* Notify content module when this module is disabled. * Notify content module when this module is disabled.
*/ */
function email_disable() { function email_disable() {
drupal_load('module', 'content');
content_notify('disable', 'email'); content_notify('disable', 'email');
} }
...@@ -45,6 +46,11 @@ function email_disable() { ...@@ -45,6 +46,11 @@ function email_disable() {
* database to NULL. * database to NULL.
*/ */
function email_update_6001() { function email_update_6001() {
if ($abort = content_check_update('email')) {
return $abort;
}
drupal_load('module', 'content');
$ret = array(); $ret = array();
$ret[] = update_sql("UPDATE {". content_instance_tablename() ."} SET widget_type = 'email_textfield' WHERE widget_type = 'email'"); $ret[] = update_sql("UPDATE {". content_instance_tablename() ."} SET widget_type = 'email_textfield' WHERE widget_type = 'email'");
content_associate_fields('email'); content_associate_fields('email');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment