Need to update the hook_views_pre_view API example code to match actual functionality. Calling $view->id() is the correct way not $view->name
Original post
API page: https://api.drupal.org/api/drupal/core%21modules%21views%21views.api.php...
The code in the example function body is incorrect. Where it says $view->name
, it should say $view->id()
.