Views2 Handlers: Fatal Error Class 'views_handler_field' not found I am working on a module and want exposing some fields to Views and provide some custom filters. But I can't extend any Views classes without drawing a fatal error. My code looks something like this. It all works fine until I try to extend views_handler_field.

&lt;?php
// $Id$
/**
 * @files
 *  Provide functionality for views.
 */
/**
 * Get some data and set some handlers.
 */
 function custom_views_data() {
      $data = array();
    $data['custom']['table']['group']  = t('custom');     
    $data['custom']['table']['join'] = array(
      'node' =&gt; array(
        'left_field' =&gt; 'nid',
        'field' =&gt; 'nid',
      ),
    );
    // Has form
    $data['custom']['is_checked'] = array(
      'title' =&gt; t('Has contest form'),
      'help' =&gt; t('Filter based on presence of a contest form. Nodes with contest forms will equal 1.'),
      'field' =&gt; array(
        'handler' =&gt; 'views_handler_field',
        'click sortable' =&gt; FALSE,
      ),
      'filter' =&gt; array(
        'handler' =&gt; 'views_handler_filter_string',
      )
    );
    return $data;
 }

 // If you remove everything below here, things work as expected

 /**
  *
  * Define custom handlers.
  */
 function custom_views_handlers() {
      return array(
        'info' =&gt; array(
          'path' =&gt; drupal_get_path('module', 'custom')
        ),
        'handlers' =&gt; array(
          'custom_handler_is_checked_field' =&gt; array(
            'parent' =&gt; 'views_handler_field'
          )
        )
      );

 }

 /**
  * This class fails with Fatal error: Class 'views_handler_field' not found 
  *
  */
class custom_handler_is_checked_field extends views_handler_field {}
Is your class code in the same file as your hook, aka the .module or .views.inc file? That doesn't work because views_handler_field is in a separate file and only loaded when required.

You need to move it in a separate file which as the same name as your class and the ending ".inc", inside the folder that you defined in 'path'. (in your case, your module directory, for large modules with many files, it's recommended to place them in a views directory)

Then, views will automatically include your class including the file that contains views_handler_field (because you defined the parent relationship in your hook) when required.