Problem/Motivation

During 7.x-2.0 and 7.x-2.1 release 2 classes were added in the handler folder. And, if it matters, one of the new classes extends the other new class. When users run an updatedb, drupal complains about the first new not existing

PHP Fatal error: Class 'draggableviews_hierarchy_handler' not found in /var/www/vhosts/****/sites/all/modules/draggableviews/handlers/draggableviews_hierarchy_handler_native.inc on line 15
Drush command terminated abnormally due to an unrecoverable error. [error]

Line 15 is the beginning of the class where draggableviews_hierarchy_handler_native.inc extends draggableviews_hierarchy_handler.

I am pretty sure this problems occurs because the classes are not in the system table yet. What is the best solutions for this? Do I have to create an update hook that flushes all the caches (probably twice) for the classes to get registered?

Additional Code

draggableviews.module

**
 * Implements hook_ctools_plugin_type().
 */
function draggableviews_ctools_plugin_type() {
  return array(
    'handler' => array(
      'use hooks' => FALSE,
    ),
    'hierarchy_handler' => array(
      'use hooks' => FALSE,
    ),
  );
}

/**
 * Implements hook_ctools_plugin_directory().
 */
function draggableviews_ctools_plugin_directory($module, $plugin) {
  if (($module == 'draggableviews') && ($plugin == 'handler' || $plugin == 'hierarchy_handler')) {
    return 'handlers';
  }
}

draggableviews.info

files[] = handlers/draggableviews_hierarchy_handler.inc
files[] = handlers/draggableviews_hierarchy_handler_native.inc

Comments

istryker’s picture

Component: Documentation » Plugins system
mustanggb’s picture

Status: Active » Closed (outdated)