Migrating views from D7 to D9 with this plugin do not succeed

Created on 11 November 2022, about 2 years ago
Updated 18 August 2024, 4 months ago

Problem/Motivation

When migrating Views using the views_migration module, I note that all the Views that have Data Export using this module have failed. If i disable the Display that is using Data Export then the migration succeeds.

Steps to reproduce

Create a simple Content based View - add a display using Data Export. Save. Run the migration. check the msgs to see the problem

PHP Fatal error: Uncaught Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats() in /srv/www/iussp/iussp-d9.fudev.co.nz/web/core/modules/rest/src/Plugin/views/display/RestExport.php:351

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand petednz

Live updates comments and jobs are added and updated live.
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.

  • πŸ‡ΊπŸ‡ΈUnited States smethawee

    Hello All,

    I got the same issue, Even I following the#3 and updated views_migration to 1.2.6. Any help on this case please?

    Thanks!

    ---------------------------------------------------------------------
    PHP Fatal error: Uncaught Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats() in /var/www/html/docroot/core/modules/rest/src/Plugin/views/display/RestExport.php:351
    Stack trace:
    #0 /var/www/html/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 /var/www/html/docroot/core/lib/Drupal/Core/Routing/RouteBuilder.php(146): call_user_func(Array)
    #3 /var/www/html/docroot/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
    #4 /var/www/html/docroot/core/includes/common.inc(587): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
    #5 /var/www/html/docroot/core/includes/utility.inc(41): drupal_flush_all_caches(Object(Drupal\Core\DrupalKernel))
    #6 /var/www/html/vendor/drush/drush/src/Commands/core/CacheCommands.php(228): drupal_rebuild(Object(Composer\Autoload\ClassLoader), Object(Symfony\Component\HttpFoundation\Request))
    #7 [internal function]: Drush\Commands\core\CacheCommands->rebuild(Array)
    #8 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
    #9 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
    #10 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
    #11 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(390): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
    #12 /var/www/html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #13 /var/www/html/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #14 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #15 /var/www/html/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #16 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #17 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
    #18 /var/www/html/vendor/drush/drush/drush.php(77): Drush\Runtime\Runtime->run(Array)
    #19 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
    #20 {main}
    thrown in /var/www/html/docroot/core/modules/rest/src/Plugin/views/display/RestExport.php on line 351

    Fatal error: Uncaught Error: Call to undefined method Drupal\views\Plugin\views\style\DefaultStyle::getFormats() in /var/www/html/docroot/core/modules/rest/src/Plugin/views/display/RestExport.php:351
    Stack trace:
    #0 /var/www/html/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 /var/www/html/docroot/core/lib/Drupal/Core/Routing/RouteBuilder.php(146): call_user_func(Array)
    #3 /var/www/html/docroot/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
    #4 /var/www/html/docroot/core/includes/common.inc(587): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
    #5 /var/www/html/docroot/core/includes/utility.inc(41): drupal_flush_all_caches(Object(Drupal\Core\DrupalKernel))
    #6 /var/www/html/vendor/drush/drush/src/Commands/core/CacheCommands.php(228): drupal_rebuild(Object(Composer\Autoload\ClassLoader), Object(Symfony\Component\HttpFoundation\Request))
    #7 [internal function]: Drush\Commands\core\CacheCommands->rebuild(Array)
    #8 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
    #9 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
    #10 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
    #11 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(390): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
    #12 /var/www/html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #13 /var/www/html/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #14 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #15 /var/www/html/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #16 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #17 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
    #18 /var/www/html/vendor/drush/drush/drush.php(77): Drush\Runtime\Runtime->run(Array)
    #19 /var/www/html/vendor/drush/drush/drush(4): require('/var/www/html/v...')
    #20 {main}
    thrown in /var/www/html/docroot/core/modules/rest/src/Plugin/views/display/RestExport.php on line 351
    [warning] Drush command terminated abnormally.
    Failed to run drush cr: exit status 1

  • πŸ‡©πŸ‡ͺGermany marc.bau

    Same issue here: I disabled the views_data_export 8.x-1.4 module now to be able to migrate.

Production build 0.71.5 2024