Notice: Undefined index: theme in theme_functions() (line 513 of /var/www/mirabel/drupal/sites/all/modules/views/includes/plugins.inc

I'm getting this notice in the advanced information popup (/admin/structure/views/nojs/display/presse/page/analyze-theme), with a content view, using a simple child theme (if related at all).

Adding if(empty($this->definition['theme'])){var_dump($this->definition);die();} in includes/plugins.inc / theme_functions() :

array
  'title' => string 'Contenu' (length=7)
  'help' => string 'Afficher le contenu avec une vue standard de nSud.' (length=51)
  'handler' => string 'views_plugin_row_node_view' (length=26)
  'path' => string 'sites/all/modules/views/modules/node' (length=36)
  'base' => 
    array
      0 => string 'node' (length=4)
  'uses options' => boolean true
  'type' => string 'normal' (length=6)
  'help topic' => string 'style-node' (length=10)
  'module' => string 'views' (length=5)
  'theme path' => string 'sites/all/modules/views/theme' (length=29)
  'theme file' => string 'theme.inc' (length=9)
  'file' => string 'views_plugin_row_node_view.inc' (length=30)
  'parent' => string 'parent' (length=6)
  'name' => string 'node' (length=4)

maybe related : #1302696: Views Facet Block produces PHP notice Undefined Index

Comments

drzraf’s picture

StatusFileSize
new501 bytes

Display is called presse, information popup, Row style output,
without a patch, but ignoring the notice with :
return views_theme_functions(@$this->definition['theme'], $this->view, $this->display); :

it writes:
.tpl.php, --presse.tpl.php, --default.tpl.php, --default.tpl.php, --page.tpl.php, --presse--page.tpl.php

with the attached (quite dumb) patch:
views-view.tpl.php, views-view--presse.tpl.php, views-view--default.tpl.php, views-view--default.tpl.php, views-view--page.tpl.php, views-view--presse--page.tpl.php

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new948 bytes

Here is a patch which adds a bunch of suggestions how it worked in d6

Status: Needs review » Needs work

The last submitted patch, 1491082-node-theme-function.patch, failed testing.

mkadin’s picture

I can confirm this bug and that the patch in #1 allowed me to bring up the information popup.

drzraf’s picture

Status: Needs work » Needs review

#2: 1491082-node-theme-function.patch queued for re-testing.

drzraf’s picture

at least the information popup display a more correct set of information after patch #2

Status: Needs review » Needs work

The last submitted patch, 1491082-node-theme-function.patch, failed testing.

drzraf’s picture

Status: Needs work » Needs review
StatusFileSize
new955 bytes

rerolled without any functional change

The last submitted patch, 1491082-7-node-theme-function.patch, failed testing.

mudderklirren’s picture

Status: Needs review » Needs work

Try disabling Devel - that did the trick for me

PedroKTFC’s picture

Bizarre! I can confirm that disabling devel gets rid of it. But isn't devel trapping the error anyway? Has the problem really gone away?!

jesss’s picture

Disabling devel does make the error message go away, but the row style output suggestions are still missing everything before the double hyphen, so it doesn't solve the problem.

rvelhote’s picture

I also had this problem and had the devel module enabled but I just had to change the Error handlers to Standard Drupal

hedel’s picture

#1 from @drzraf was working for me! thanks!

hedel’s picture

Issue summary: View changes

related bug ?

pere orga’s picture

Issue summary: View changes

Disabling Devel works

interdruper’s picture

I can confirm that #13 also gets rid of it, without requiring to disable Devel.

othermachines’s picture

- Confirm problem still exists with most recent -dev (7.x-3.7+38-dev).
- Confirm disabling Devel or changing Devel setting as in #13 removes error, but template suggestions are not fully formed.
- Confirm #8 patch (@drzraf) resolves error and provides the following template suggestions:

Row style output: node.tpl.php, node--testview.tpl.php, node--default.tpl.php, node--default.tpl.php, node--page.tpl.php, node--testview--page.tpl.php
DrCord’s picture

The patch in #1 seemed to work for me fine. My template suggestions seem correct.

Cyclodex’s picture

Confirm problem still with version 7.x-3.10.
The row style output is not correct without the patch from #1.

Can someone check this, why this happens or if this patch really should be applied?!

UPDATE:
I also tried #8 which does add the node string to the suggestions, but it breaks my views. I can't preview anymore the content and get ajax error.

I look closer to the row suggestion, and the title which normally shows you the suggested code sais:

This display has no row style theming information

So perhaps it simply should not show anything?
I have no idea here, just try to help with some insights.

Anonymous’s picture

@Cyclodex,
perhaps your view display format is set to “content”, if you change it to field and add one field, you should be able to see the template in the theme info overlay.

the patch in #1 works.

  • colan committed 0f54f7f on 7.x-3.x authored by drzraf
    Issue #1491082 by drzraf, dawehner, colan: Set a default template if...
colan’s picture

Status: Needs work » Fixed

Thanks all. Committed #1 with proper coding standards.

colan’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 7.x-3.x-dev » 8.0.x-dev
Component: Miscellaneous » views.module
Status: Fixed » Patch (to be ported)

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

catch’s picture

Status: Patch (to be ported) » Needs work

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

lendude’s picture

Project: Drupal core » Views (for Drupal 7)
Version: 8.9.x-dev » 8.x-3.x-dev
Component: views.module » Code
Status: Needs work » Fixed

Closing this. If somebody has some steps to reproduce this on D8 feel free to reopen this or open a new issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.