Problem/Motivation

\Drupal\rest\Plugin\views\display\RestExport::initDisplay may be invoked during route rebuilding via cache clear. If this method is invoked without a request, via drush for example, this can cause a fatal error.

Call to a member function getRequestFormat() on null in Drupal\rest\Plugin\views\display\RestExport->initDisplay()

Steps to reproduce

* Create a rest export view with a path
* Rebuild cache via drush

Proposed resolution

* Do not assume the request exists

Remaining tasks

* Update initDisplay method to check for request existence before invoking methods on it.
* Update \Drupal\views\ViewExecutable::getRequest docblock @return statement to include null as a possible return value.
* Does the property \Drupal\views\ViewExecutable::$request need to be updated to explicitly allow null?

User interface changes

none

Introduced terminology

none

API changes

none

Data model changes

none

Release notes snippet

Issue fork drupal-3532439

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

aaronbauman created an issue. See original summary.

quietone’s picture

Version: 11.2.x-dev » 11.x-dev

In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies. Also mentioned on the version section of the list of issue fields documentation.

aaronbauman changed the visibility of the branch 3532439-TEST-ONLY to hidden.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.