hi, i have a big problem with views and my site (Drupal 7). When i've created a new view (or change a old one) the system doesn't let me to theme the Row style output.
It shows in the edit mode in a view:
Row style output: .tpl.php, --front-headline.tpl.php, --default.tpl.php, --default.tpl.php, --block.tpl.php, --front-headline--block.tpl.php
But Display and style output are normal with the names.

When i look in thev recent log messages i can see this error that shows every time:
Notice: Undefined index: theme in views_plugin->theme_functions() (line 512 of /Users/Oscar/Sites/pfss/sites/all/modules/views/includes/plugins.inc).

Type: php
Location: http://localhost/admin/structure/views/ajax/display/front_headline/block...
Referrer: http://localhost/admin/structure/views/view/front_headline/edit?render=o...

I've tried to make a a lot of clean installations with drupal, views and ctools. Both the dev and recommended release, without success, all time the same error and problem.

What can i do?

Comments

merlinofchaos’s picture

So what row style (The "Show" setting in the view) are you using?

oscarandersson92’s picture

Im using the content style.

oscarandersson92’s picture

What can the problem be? Why do i get this error?

hwasem’s picture

I'm also getting this error using the Format Show: Content | Teaser. I don't get the error when I use the Fields format.

I discovered this error when I changed the Format Show value from Fields to Content. I changed the views template file and was going to rescan the theme files. I get the error after opening the Theme: Information link.

Did you ever find the cause for the error?

kobnim’s picture

Version: 7.x-3.3 » 7.x-3.6

I am attempting to follow the tutorial here for creating a row-plugin. Here is the example code:

function views_json_views_plugins() {
  return array(
    'row' => array( //declare the unformatted row plugin
      'unformatted' => array(
        'title' => t('Unformatted'),
        'help' => t('(Displays the unformatted data for each row from the views query with each row on a new line. Set as | for views_json.'),
        'handler' => 'views_plugin_row_unformatted',
        'theme' => 'views_view_row_unformatted',
        'uses fields' => TRUE,
        'uses options' => TRUE,
        'type' => 'normal',
      )
     )  
  );
}

class views_plugin_row_unformatted extends views_plugin_row {
    
  function option_definition() {
    $options = parent::option_definition();
    $options['separator'] = array('default' => '|');
    return $options; // <-------------------- I added this line to the tutorial.  I believe it is required.  No?
  }

  /**
   * Provide a form for setting options.
   */
  function options_form(&$form, &$form_state) {
    $fields = $this->display->handler->get_option('fields');
    $options = array();
    foreach ($fields as $field => $info) {
      $handler = views_get_handler($info['table'], $info['field'], 'field');
      if ($handler) {
        $options[$field] = $handler->ui_name();
      }
    }
  
    $form['separator'] = array(
      '#title' => t('Separator'),
      '#type' => 'textfield',
      '#size' => 10,
      '#default_value' => isset($this->options['separator']) ? $this->options['separator'] : ',',
      '#description' => t('The separator is placed between fields.'),
    );
  }
  
}

I created a view, and under 'format', I set 'show' to 'Unformatted'.
When I attempt to display my view, I get the following error:

Notice: Undefined index: theme in views_plugin->theme_functions() (line 529 of /mysite/sites/all/modules/views/includes/plugins.inc).

Does anyone know what may be causing this problem?

Thanks very much
Mindy

P.S. I tried deleting the following code from function options_form(), but that did not resolve the problem:

    $fields = $this->display->handler->get_option('fields');
    $options = array();
    foreach ($fields as $field => $info) {
      $handler = views_get_handler($info['table'], $info['field'], 'field');
      if ($handler) {
        $options[$field] = $handler->ui_name();
      }
    }
kobnim’s picture

Never mind. My mistake. I had commented out this 'theme' line in hook_views_plugins(), in an earlier attempt to debug a different problem:

'theme' => 'views_view_row_unformatted',

The "undefined index" error message went away when I uncommented this line.

I don't believe my resolution sheds any light on the problem others are having, so I am leaving this issue "active".

stephenrobinson’s picture

Issue summary: View changes

I get this error as well, and a defective pager for one of my views using

Show:Content | Full content

FILTER CRITERIA
Content: Published (Yes)
Content: Type (= Lost And Found)
(flag) Flags: Flagged (False/True/No Option)

SORT CRITERIA
Content: Post date (asc/desc) 

RELATIONSHIPS
Flags: found (by any user)
Anonymous’s picture

This patch https://www.drupal.org/node/1491082#comment-5755586 fixed the issue for me.

colan’s picture