- Issue created by @lkuttner
Get us the update identifier. It is probably the first on in the list.
I searched Google for "Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats()" and found a few issues, such as:
- 💬 Migrating views from D7 to D9 with this plugin do not succeed Active
- 💬 REST views: Uncaught Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats() Fixed
- 🐛 Fatal error on Drupal 8.5, on a data_export display that uses not the data_export style but the *default* style Postponed: needs info
Is this result from drush updatedb:status what you are looking for? Thanks.
------------------ ------------------------------------------ --------------- Module Update ID Type ------------------ ------------------------------------------ --------------- file entity type entity-update ckeditor omit_settings_for_disabled_plugins post-update image image_loading_attribute post-update system enable_provider_database_driver post-update update add_view_update_notifications_permission post-update views image_lazy_load post-update views provide_revision_table_relationship post-update
I did not see any numeric identifiers in the Drush output-- is there another way to view them?
I had seen the issues in #3-- the first one includes comments from me about an earlier WSOD that I did resolve.
The other threads have been a dead-end, and while this issue may be related, I do not know enough to determine that.Not yet. I figured that I should resolve current issues before running that. I ran all the other migrations.
Ah, the reason those updates don't have numerical identifiers is because they are all post_update hooks.
Can you get a stack trace?
How's this? Thanks.
Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats() in Drupal\rest\Plugin\views\display\RestExport->collectRoutes() (line 351 of /var/www/cascade/prod/nesea.org/webroot/web/core/modules/rest/src/Plugin/views/display/RestExport.php) #0 /var/www/cascade/prod/nesea.org/webroot/web/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 /var/www/cascade/prod/nesea.org/webroot/web/core/lib/Drupal/Core/Routing/RouteBuilder.php(146): call_user_func(Array) #3 /var/www/cascade/prod/nesea.org/webroot/web/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild() #4 /var/www/cascade/prod/nesea.org/webroot/web/core/includes/common.inc(587): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() #5 /var/www/cascade/prod/nesea.org/webroot/web/core/modules/system/src/Controller/DbUpdateController.php(662): drupal_flush_all_caches() #6 /var/www/cascade/prod/nesea.org/webroot/web/core/includes/batch.inc(456): Drupal\system\Controller\DbUpdateController::batchFinished(false, Array, Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup)) #7 /var/www/cascade/prod/nesea.org/webroot/web/core/includes/batch.inc(98): _batch_finished() #8 /var/www/cascade/prod/nesea.org/webroot/web/core/modules/system/src/Controller/DbUpdateController.php(186): _batch_page(Object(Symfony\Component\HttpFoundation\Request)) #9 [internal function]: Drupal\system\Controller\DbUpdateController->handle('start', Object(Symfony\Component\HttpFoundation\Request)) #10 /var/www/cascade/prod/nesea.org/webroot/web/core/lib/Drupal/Core/Update/UpdateKernel.php(115): call_user_func_array(Array, Array) #11 /var/www/cascade/prod/nesea.org/webroot/web/core/lib/Drupal/Core/Update/UpdateKernel.php(76): Drupal\Core\Update\UpdateKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request)) #12 /var/www/cascade/prod/nesea.org/webroot/web/update.php(27): Drupal\Core\Update\UpdateKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #13 {main}
This really looks quite a bit like the issues I linked in #3 and those are probably the best place for any information on this.
In RestExport, lines 346 to 351 are:
$style_plugin = $this->getPlugin('style'); // REST exports should only respond to GET methods. $route->setMethods(['GET']); $formats = $style_plugin->getFormats();
$style_plugin
can be null or of a type that isn't expected. In this case it is an instance ofDrupal\views\Plugin\views\style\DefaultStyle
, which is exactly what is reported in 💬 REST views: Uncaught Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats() Fixed and duplicated onto 🐛 Fatal error on Drupal 8.5, on a data_export display that uses not the data_export style but the *default* style Postponed: needs info . I really think this is already being discussed in those places.Are there any views with Rest data exports? Check their style settings. Does the site use Views data export module?
Yes, there is one Rest data export from before my time, and we do use the Views data export module. I just looked at the Rest settings for the first time. I do not see where style settings are defned. Where should I look for them? Thanks.
I have no idea. I really think those other issues are the place to look. They include exports of affected views and suggestions on fixing them.
- Status changed to Closed: duplicate
almost 2 years ago 4:22pm 9 February 2023 Open this again if it turns out to be truly unique. But it will need supporting information that it is truly unique.
Good luck with this!
Consider re-creating the REST export and deleting the old one. That may sort it out.
- 🇸🇪Sweden arne_hortell
In core/modules/rest/src/Plugin/views/display/RestExport.php function collectRoutes
find the line
$formats = $style_plugin->getFormats();replace with
$formats=false;
if (method_exists($style_plugin,'getFormats'))
$formats = $style_plugin->getFormats();