upgrading to Drupal 7.36 May Cause Node Types to be disabled.

After updating to Drupal 7.36, many strange problems began to occur. If your content type is build by a module, may cause node types to be disabled.
you can fix this problem by following code into a custom module and enable it:

  1. <?php
  2. /**
  3.  * Rescue content types that might disappear with 7.36.
  4.  */
  5. function aow_custom_update_7005() {
  6. // Spin through the node_type table.
  7. // This is only good where we don't have deleted node type modules or features.
  8. $ret = '';
  9. $result = db_query("SELECT type, name, module FROM {node_type} WHERE module <> 'node'");
  10.  
  11. foreach ($result as $row) {
  12. if (!module_exists($row->module)) {
  13. $x = db_update('node_type')
  14. ->fields(array(
  15. 'module' => 'node', // Give it back to the Node module.
  16. 'custom' => 1,
  17. 'modified' => 1,
  18. 'locked' => 0,
  19. 'disabled' => 0,
  20. ))
  21. ->condition('type', $row->type)
  22. ->execute();
  23. $ret .= '<p>' . check_plain("$row->name content type rescued from the missing '$row->module' module.") . '</p>';
  24. }
  25. }
  26.  
  27. return $ret;
  28. }
  29. ?>


Article Information
Article ID Categories Tags Levels Status
#27
Free
Solved

Comments

A

Upgarding to Drupal 7.37 solving this problem.