There is no display available. Please select another view or change the field settings.

Created on 1 May 2023, about 1 year ago
Updated 14 June 2024, 14 days ago

Problem/Motivation

I was getting this error and when I searched the issue queue I found https://www.drupal.org/project/viewsreference/issues/2919237 🐛 "There is no view display available." being thrown out with activated "Views reference autocomplete" widget Fixed . My issue is different because it was happening on both widgets. After a bit of debugging, I realized that in the fields settings you have to set the allowed display modes but it is not a required field. This is different for other field settings, e.g. paragraphs, where you can set the include/exclude by your selection.

A simple solution would be to make the field required.

Steps to reproduce

  1. Enable module
  2. add viewsreference field to any content entity
  3. unselect all displays
  4. save field
  5. try to add new content
  6. confirm you get the following error There is no display available. Please select another view or change the field settings.
  7. Ajax error

    "
    An AJAX HTTP error occurred.
    HTTP Result Code: 200
    Debugging information follows.
    Path: /node/add/page?ajax_form=1&_wrapper_format=drupal_ajax
    StatusText: parsererror
    ResponseText: 
    Warning:  Undefined array key "data" in /var/www/html/docroot/modules/contrib/viewsreference/src/Plugin/Field/FieldType/ViewsReferenceItem.php on line 97
    Deprecated:  unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in /var/www/html/docroot/modules/contrib/viewsreference/src/Plugin/Field/FieldType/ViewsReferenceItem.php on line 97
    Warning:  Undefined array key "data" in /var/www/html/docroot/modules/contrib/viewsreference/src/Plugin/Field/FieldType/ViewsReferenceItem.php on line 97
    Deprecated:  unserialize(): Passing null to parameter #1 ($data) of type string is deprecated in /var/www/html/docroot/modules/contrib/viewsreference/src/Plugin/Field/FieldType/ViewsReferenceItem.php on line 97
    

Proposed resolution

make the field required.

Remaining tasks

User interface changes

The allowed display ids will be required.

API changes

Data model changes

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States robpowell Boston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024