This issue was originally described here: #2879310-3: Problems with AJAX configuration form when using a contextual filter and steps to reproduce were provided by @skitten in #3.
To reproduce without installing vbo D8 prototype and test module, my guess the simpliest way is to add an AJAX callback in any views field plugin viewsForm method and set a view with a contextual filter, first AJAX response is OK, second one causes:
Error: Call to a member function getRouteByName() on null in Drupal\views\ViewExecutable->getUrl() (line 1955 of core/modules/views/src/ViewExecutable.php).
NOTE: without a contextual filter all works as expected.
It probably has something to do with https://www.drupal.org/node/2849674, but it's more a guess.
A temporary solution that unfortunately violates good practices of dependency injection (therefore no patch uploaded):
+ if (!is_object($this->routeProvider) || !method_exists($this->routeProvider, 'getRouteName')) {
+ $this->routeProvider = \Drupal::service('router.route_provider');
+ }
$route = $this->routeProvider->getRouteByName($url->getRouteName());
Comments
Comment #2
Graber CreditAttribution: Graber as a volunteer commentedComment #3
joelpittet