REST views: Uncaught Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats()

Created on 21 March 2018, over 6 years ago
Updated 8 July 2023, about 1 year ago

Problem/Motivation

When flushing the cache on a site recently upgraded to Drupal 8.5, I am now getting a fatal uncaught error:

 Rebuilding cache(s), wait a moment please.
PHP Fatal error:  Uncaught Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats() in /app/docroot/core/modules/rest/src/Plugin/views/display/RestExport.php:368
Stack trace:
#0 /app/docroot/core/modules/views/src/EventSubscriber/RouteSubscriber.php(120): Drupal\rest\Plugin\views\display\RestExport->collectRoutes(Object(Symfony\Component\Routing\RouteCollection))
#1 [internal function]: Drupal\views\EventSubscriber\RouteSubscriber->routes()
#2 /app/docroot/core/lib/Drupal/Core/Routing/RouteBuilder.php(146): call_user_func(Array)
#3 /app/docroot/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#4 /app/docroot/core/includes/common.inc(1156): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#5 /app/vendor/drupal/console/src/Utils/DrupalApi.php(355): drupal_flush_all_caches()
#6 /app/vendor/drupal/console/src/Command/Cache/RebuildCommand.php(103): Drupal\Console\Utils\DrupalApi->drupal_rebuild(Object(Symfony\Component\ClassLoader\ApcCl in /app/docroot/core/modules/rest/src/Plugin/views/display/RestExport.php on line 368

Fatal error: Uncaught Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats() in /app/docroot/core/modules/rest/src/Plugin/views/display/RestExport.php on line 368

Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats() in /app/docroot/core/modules/rest/src/Plugin/views/display/RestExport.php on line 368

API changes

Upgrade to Drupal 8.5

πŸ’¬ Support request
Status

Fixed

Version

11.0 πŸ”₯

Component
RESTΒ  β†’

Last updated 6 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States brooke_heaton

Live updates comments and jobs are added and updated live.
  • VDC

    Related to the Views in Drupal Core initiative.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024