Problem/Motivation
Broken/missing handler on Custom Block Library view - Drupal 8.0.3
Steps to reproduce:
- simplytest.me or manual test Drupal 8.0.3. Both tested.
- Use standard or minimal install profile. Both tested.
- Land on front page: Congrats... drupal is installed.
- Go to admin/structure/views/block-content or admin/structure/views and click "Edit" the Custom Block Library view
- 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:
- Click on broken/missing handler link.
- Save all displays
- Close window.
- 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
- Find what has changed between 8.0.0-rc1 and 8.0.3 and update issue.
- Seek input if needed to create a patch to fix the issue.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#7 | 2663758-7.patch | 1.31 KB | Chi |
#5 | custom_block_library_filter-2663758-5.patch | 595 bytes | Lendude |
simplytest 8.0.0-rc1 .png | 67.96 KB | no_angel | |
Notice Undefined index id line 862.png | 65.04 KB | no_angel | |
Notice Undefined index field line 88 .png | 68.69 KB | no_angel |
Comments
Comment #2
no_angel CreditAttribution: no_angel as a volunteer commentedComment #3
no_angel CreditAttribution: no_angel as a volunteer commentedComment #4
no_angel CreditAttribution: no_angel as a volunteer commentedComment #5
LendudeIt seems the config is pointing to the wrong table.
Needs some tests still.
Edit: Moved it to the right queue
Comment #6
Lendudesetting to Needs work for the tests.
Comment #7
Chi CreditAttribution: Chi commentedAdded tests.
Comment #8
mlncn CreditAttribution: mlncn at Agaric for MASS Design Group commentedThis 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?
Comment #11
catchCommitted/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?