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
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
Comment #4
quietone commentedIn 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.
Comment #6
aaronbaumanDepends on #3532360: Check return value from getCurrentRequest() before calling setRequest() in ViewExecutableFactory