Problem/Motivation

Broken/missing handler on Custom Block Library view - Drupal 8.0.3

Steps to reproduce:

  1. simplytest.me or manual test Drupal 8.0.3. Both tested.
  2. Use standard or minimal install profile. Both tested.
  3. Land on front page: Congrats... drupal is installed.
  4. Go to admin/structure/views/block-content or admin/structure/views and click "Edit" the Custom Block Library view
  5. Look at Filter Criteria: See broken/missing handler. https://rm8yx.ply.st/admin/structure/views/nojs/handler/block_content/pa...

Do the same steps on 8.0.0-rc1 and no broken/missing handler message displayed.

Steps to reproduce log messages:

  1. Click on broken/missing handler link.
  2. Save all displays
  3. Close window.
  4. Go to admin/reports/recent log messages

Undefined index: field in Drupal\views\Plugin\ViewsHandlerManager->getHandler() (line 88 of core/modules/views/src/Plugin/ViewsHandlerManager.php).
Undefined index: table in Drupal\views\Plugin\ViewsHandlerManager->getHandler() (line 87 of core/modules/views/src/Plugin/ViewsHandlerManager.php).
Undefined index: id in Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers() (line 862 of core/modules/views/src/Plugin/views/display/DisplayPluginBase.php).

/**
* Fetches a handler from the data cache.
*
* @param array $item
* An associative array representing the handler to be retrieved:
* - table: The name of the table containing the handler.
* - field: The name of the field the handler represents.
* @param string|null $override
* (optional) Override the actual handler object with this plugin ID. Used for
* aggregation when the handler is redirected to the aggregation handler.
*
* @return \Drupal\views\Plugin\views\ViewsHandlerInterface
* An instance of a handler object. May be a broken handler instance.
*/
public function getHandler($item, $override = NULL) {
$table = $item['table']; line 87
$field = $item['field']; line 88

/**
* {@inheritdoc}
*/
public function &getHandlers($type) {
if (!isset($this->handlers[$type])) {
$this->handlers[$type] = array();
$types = ViewExecutable::getHandlerTypes();
$plural = $types[$type]['plural'];

// Cast to an array so that if the display does not have any handlers of
// this type there is no PHP error.
foreach ((array) $this->getOption($plural) as $id => $info) {
// If this is during form submission and there are temporary options
// which can only appear if the view is in the edit cache, use those
// options instead. This is used for AJAX multi-step stuff.
if ($this->view->getRequest()->request->get('form_id') && isset($this->view->temporary_options[$type][$id])) {
$info = $this->view->temporary_options[$type][$id];
}

if ($info['id'] != $id) { line 862
$info['id'] = $id;

Proposed resolution

TBD

Remaining tasks

  1. Find what has changed between 8.0.0-rc1 and 8.0.3 and update issue.
  2. Seek input if needed to create a patch to fix the issue.

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

no_angel created an issue. See original summary.

no_angel’s picture

Issue summary: View changes
no_angel’s picture

Assigned: Unassigned » no_angel
no_angel’s picture

Assigned: no_angel » Unassigned
Lendude’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 8.x-3.x-dev » 8.1.x-dev
Component: Views Data » block_content.module
Status: Active » Needs review
Issue tags: +Needs tests
FileSize
595 bytes

It seems the config is pointing to the wrong table.

Needs some tests still.

Edit: Moved it to the right queue

Lendude’s picture

Status: Needs review » Needs work
Issue tags: +VDC

setting to Needs work for the tests.

Chi’s picture

Status: Needs work » Needs review
FileSize
1.31 KB

Added tests.

mlncn’s picture

Status: Needs review » Reviewed & tested by the community

This fixes it for new sites! Nice work.

Is there any way to update the configuration for existing sites, at least sites that haven't already edited the block_content view?

  • catch committed 0bbc9e3 on 8.2.x
    Issue #2663758 by Lendude, Chi, no_angel: Broken/missing handler on...

  • catch committed 34bb95f on 8.1.x
    Issue #2663758 by Lendude, Chi, no_angel: Broken/missing handler on...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!

@mlncn it's worth an issue to try updating the existing configuration via an update - could you open a follow-up?

Status: Fixed » Closed (fixed)

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