You are here

function optionwidgets_update_6000 in Content Construction Kit (CCK) 6

Same name and namespace in other branches
  1. 6.3 modules/optionwidgets/optionwidgets.install \optionwidgets_update_6000()
  2. 6.2 modules/optionwidgets/optionwidgets.install \optionwidgets_update_6000()

Rename widgets from 'options_xxx' to 'optionwidgets_xxx' so hook_elements and hook_themes items are prefixed with module name as they should be.

The change in widget types will keep content_update_6000() from correctly updating the module names in the field and instance tables, so do it here.

File

modules/optionwidgets/optionwidgets.install, line 50

Code

function optionwidgets_update_6000() {
  $ret = array();
  $ret[] = update_sql("UPDATE {" . content_instance_tablename() . "} SET widget_type = 'optionwidgets_select' WHERE widget_type = 'options_select'");
  $ret[] = update_sql("UPDATE {" . content_instance_tablename() . "} SET widget_type = 'optionwidgets_onoff' WHERE widget_type = 'options_onoff'");
  $ret[] = update_sql("UPDATE {" . content_instance_tablename() . "} SET widget_type = 'optionwidgets_buttons' WHERE widget_type = 'options_buttons'");
  content_associate_fields('optionwidgets');
  return $ret;
}