I have a newly installed drupal with minimum profile, version 8.1.1.
I enabled views module.
I added a content type and installed Workbench and Workbench moderation modules.
I enabled moderation states for my content type.
I added Access My Workbench permission to authenticated users.
When I click on My Workbench button I receive the following error:

Recoverable fatal error: Argument 1 passed to Drupal\views\ViewExecutableFactory::get() must implement interface Drupal\views\ViewEntityInterface, null given, called in /var/www/html/.../core/modules/views/src/Plugin/Block/ViewsBlockBase.php on line 69 and defined in Drupal\views\ViewExecutableFactory->get() (line 70 of /var/www/html/.../core/modules/views/src/ViewExecutableFactory.php).

After some investigations it occured that the views.view.workbench_current_user.yml file in workbench/config/optional folder was not imported. The possible reason might be that it refers to user_picture field
user_picture:
id: user_picture
table: user__user_picture
field: user_picture
which I do not have because of my minimum install profile.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

laszlo.kovacs created an issue. See original summary.

rooby’s picture

Priority: Normal » Critical

I am having the same problem, except mine shows up as this error:

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

While checking for the existence of the view in WorkbenchContentController::content() would stop the error it seems like it would be better to not have the user picture in this view. It doesn't seem necessary and lots of sites don't use the user picture.

rooby’s picture

This patch checks the existence of views before trying to render them (not sure if there is a better way of determining the existence of a view).

rooby’s picture

Status: Active » Needs review
FileSize
2.99 KB

Here is a patch that removes the picture dependency from that view.

Not sure which of the 2 approaches would be preferred.

laszlo.kovacs’s picture

I installed drupal with minimal profile.
Enabled workbench and workbench moderation.
Applied the patches #3 and #4 and the problem was gone.
Thank you :-)

geoffvio’s picture

I also have an error when open "My Workbench", but seems a different one, a problem with langcode column...

[Wed Jun 15 17:49:03 2016] [error] [client XXX.XXX.XXX.XXX] Uncaught PHP Exception Drupal\\Core\\Database\\IntegrityConstraintViolationException: "SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'langcode' in field list is ambiguous: SELECT node_field_data_node_field_revision.langcode AS node_field_data_node_field_revision_langcode, node_field_revision.vid AS vid, users_field_data_node_field_revision.uid AS users_field_data_node_field_revision_uid, node_field_data_node_field_revision.nid AS node_field_data_node_field_revision_nid, langcode AS langcode\nFROM \n{node_field_revision} node_field_revision\nLEFT JOIN {users_field_data} users_field_data_node_field_revision ON node_field_revision.uid = users_field_data_node_field_revision.uid\nLEFT JOIN {node_field_data} node_field_data_node_field_revision ON node_field_revision.vid = node_field_data_node_field_revision.vid\nINNER JOIN {users} users_field_data_node_field_revision__users ON users_field_data_node_field_revision.uid = users_field_data_node_field_revision__users.uid\nWHERE ((( (users_field_data_node_field_revision__users.uid = :db_condition_placeholder_0) )AND (node_field_data_node_field_revision.type IS NOT NULL ) ))\nORDER BY node_field_revision.changed DESC\nLIMIT 5 OFFSET 0; Array\n(\n [:db_condition_placeholder_0] => 1\n)\n" at /var/www/html/d8_sandbox/core/lib/Drupal/Core/Database/Connection.php line 668, referer: http://server:8004/fr/admin/structure

rooby’s picture

@geoffvio:

I think that one looks different enough that it should have it's own issue.

agentrickard’s picture

The issue in #5 is already fixed. Please do not cloud issues with unrelated reports.

agentrickard’s picture

So this issue in general is about the problem of shipping default views. There are two other items that we might address here:

1) How to make it so the default view callback in the controller can be overridden?
2) How to extend Views when modules like Workbench Access are installed?

Given that the user picture is part of the default profile for Drupal installs, I don't see any urgency to remove it from the provided view. For cases like these, it's easy enough to edit and re-export the view. (There are people, in fact, who argue that we shouldn't ship default views at all.)

We have to cover the 80% case.

Checking for the existence of the view seems reasonable here.

  • agentrickard committed 7f17c4d on 8.x-1.x
    Patch #2732119 by rooby. Check for existence of Views in the controller.
    
agentrickard’s picture

The Views check patch has been committed.

Leaving this open for ideas about the issues raised in comment 9.

agentrickard’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

agentrickard’s picture