When I try to access admin/workbench on a new Drupal 8.1.1 website I get an HTTP Error 500 with the errors:

Fatal error: Call to a member function set() on null in core/modules/views/src/ViewExecutable.php on line 446

Fatal error: Call to a member function getCacheTags() on null in core/modules/views/src/Plugin/views/query/Sql.php on line 1552

If I access sub entries all works well:
admin/workbench/create
admin/workbench/content/edited
admin/workbench/content/all

Also note that nothing is being logged in the Watchdog table

For debugging purposes:
Database system version 5.5.49-MariaDB-1~wheezy
PHP 5.6.21
Web server nginx/1.9.15

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JulienF created an issue. See original summary.

JulienF’s picture

Issue summary: View changes
rooby’s picture

Title: HTTP Error 500 on admin/workbench » Call to a member function set() on null on admin/workbench
Version: 8.x-1.0-alpha1 » 8.x-1.x-dev
Issue summary: View changes

This also happens on latest dev and Apache 2.4.

The error is:

Fatal error: Call to a member function set() on null in core/modules/views/src/ViewExecutable.php on line 446

rooby’s picture

Title: Call to a member function set() on null on admin/workbench » HTTP 500 Fatal errors on null on admin/workbench
Issue summary: View changes

After a little more investigation, that page is rendering 3 block views.

Rendering just the 'workbench_current_user' block gives this error:

Fatal error: Call to a member function set() on null in core/modules/views/src/ViewExecutable.php on line 446

Rendering just the 'workbench_edited' block gives this error:

Fatal error: Call to a member function getCacheTags() on null in core/modules/views/src/Plugin/views/query/Sql.php on line 1552

Rendering just the 'workbench_recent_content' block give no errors.

rooby’s picture

Title: HTTP 500 Fatal errors on null on admin/workbench » HTTP 500 Fatal errors on admin/workbench
rooby’s picture

This error:

Fatal error: Call to a member function set() on null in core/modules/views/src/ViewExecutable.php on line 446

happens because for some reason the workbench_current_user view doesn't exist on my site after installing workbench and workbench_moderation modules.

Related issue: #2732119: The existence of defined views is not checked

rooby’s picture

rooby’s picture

I just had

Fatal error: Call to a member function getCacheTags() on null in core/modules/views/src/Plugin/views/query/Sql.php on line 1552

from another view that I created myself and it seemed to be directly related to having a relationship from the content revision to the content.

I have not done a search for related Drupal core issues yet.

agentrickard’s picture

Status: Active » Closed (duplicate)

Duplicate of the linked issue.

rooby’s picture

Status: Closed (duplicate) » Active

I believe only the "Call to a member function set() on null" error was a duplicate but this one still happens, and I think it relates to having a relationship from the content revision to the content.

Fatal error: Call to a member function getCacheTags() on null in /var/www/exp/core/modules/views/src/Plugin/views/query/Sql.php on line 1552

Possibly there is another issue for that somewhere but I haven't had an in depth look into it yet.

larowlan’s picture

agentrickard’s picture

"from another view that I created myself" is not an issue for this queue.

rooby’s picture

But it also happens with the view provided by this module. The workbench_edited view. That's what this is about. See comment #4.

That statement was just to illustrate that it is possibly related to the content revision relationship.

agentrickard’s picture

I can't replicate this error. The linked issue was caused when content translations were active.

Two questions:

1) Are you using content translation? Any other modules or configuration that might affect the view?

2) Are you testing against alpha2 or dev?

huma2000’s picture

I have the same issue, happens when the user have multiple nodes published and I am using the alpha version.
There are no modules that modify that view.
Tested with php versions from 5.5 to 7and always same result.

Also if one of the devs need access to my current website to see the problem, plscontactme by pm and we can arrange it.

agentrickard’s picture

I still can't replicate this.

A module like Content Translation might not modify the View, but it could modify node properties or caching in a specific way, so I still need to know what modules are installed.

Perhaps an export of your content type config would help.

huma2000’s picture

Here you have a full config export of my site (wip, so some of things on it atm), hope it helps

rooby’s picture

Gravypower’s picture

I can confirm that the patch mentioned in #18 has fixed this issue for me

agentrickard’s picture

And that patch should be included in Drupal 8.1.5, so an upgrade should fix the issue.

agentrickard’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

agentrickard’s picture