TypeError: Unsupported operand types: null + array

Created on 17 April 2023, over 1 year ago
Updated 24 April 2023, over 1 year ago

Problem/Motivation

Hi, I am facing an error from the drupal core View module. I have migrated my drupal 7 site to drupal 9. After the migration of the content I am now trying to migrate views by using a contributed module views_migration. When i run drush migrate:import d7_views_migration then i got the following error. Any help will be highly appreciated. Thanks

 [error]  TypeError: Unsupported operand types: null + array in Drupal\views\Plugin\views\field\EntityField->getFormatterInstance() (line 989 of C:\xampp\htdocs\sgbf\core\modules\views\src\Plugin\views\field\EntityField.php) #0 C:\xampp\htdocs\sgbf\core\modules\views\src\Plugin\views\field\EntityField.php(1020): Drupal\views\Plugin\views\field\EntityField->getFormatterInstance()
#1 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Plugin\PluginDependencyTrait.php(71): Drupal\views\Plugin\views\field\EntityField->calculateDependencies()
#2 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Plugin\PluginDependencyTrait.php(89): Drupal\views\Plugin\views\display\DisplayPluginBase->getPluginDependencies(Object(Drupal\views\Plugin\views\field\EntityField))
#3 [internal function]: Drupal\views\Plugin\views\display\DisplayPluginBase->calculatePluginDependencies(Object(Drupal\views\Plugin\views\field\EntityField), 0)
#4 C:\xampp\htdocs\sgbf\core\modules\views\src\Plugin\views\display\DisplayPluginBase.php(959): array_walk(Array, Array)
#5 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Plugin\PluginDependencyTrait.php(71): Drupal\views\Plugin\views\display\DisplayPluginBase->calculateDependencies()
#6 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Plugin\PluginDependencyTrait.php(89): Drupal\Core\Config\Entity\ConfigEntityBase->getPluginDependencies(Object(Drupal\views\Plugin\views\display\DefaultDisplay))
#7 C:\xampp\htdocs\sgbf\core\modules\views\src\Entity\View.php(282): Drupal\Core\Config\Entity\ConfigEntityBase->calculatePluginDependencies(Object(Drupal\views\Plugin\views\display\DefaultDisplay))
#8 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Config\Entity\ConfigEntityBase.php(320): Drupal\views\Entity\View->calculateDependencies()
#9 C:\xampp\htdocs\sgbf\core\modules\views\src\Entity\View.php(292): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#10 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Entity\EntityStorageBase.php(562): Drupal\views\Entity\View->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
#11 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Entity\EntityStorageBase.php(517): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\views\Entity\View))
#12 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Config\Entity\ConfigEntityStorage.php(253): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\views\Entity\View))
#13 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Entity\EntityBase.php(339): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\views\Entity\View))
#14 C:\xampp\htdocs\sgbf\core\lib\Drupal\Core\Config\Entity\ConfigEntityBase.php(608): Drupal\Core\Entity\EntityBase->save()
#15 C:\xampp\htdocs\sgbf\core\modules\migrate\src\Plugin\migrate\destination\EntityConfigBase.php(145): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#16 C:\xampp\htdocs\sgbf\modules\contrib\views_migration\src\Plugin\migrate\destination\ViewsMigration.php(26): Drupal\migrate\Plugin\migrate\destination\EntityConfigBase->import(Object(Drupal\migrate\Row), Array)
#17 C:\xampp\htdocs\sgbf\core\modules\migrate\src\MigrateExecutable.php(248): Drupal\views_migration\Plugin\migrate\destination\ViewsMigration->import(Object(Drupal\migrate\Row), Array)
#18 C:\xampp\htdocs\sgbf\vendor\drush\drush\includes\drush.inc(122): Drupal\migrate\MigrateExecutable->import()
#19 C:\xampp\htdocs\sgbf\vendor\drush\drush\includes\drush.inc(113): drush_call_user_func_array(Array, Array)
#20 C:\xampp\htdocs\sgbf\modules\contrib\migrate_tools\src\Commands\MigrateToolsCommands.php(953): drush_op(Array)
#21 C:\xampp\htdocs\sgbf\modules\contrib\migrate_tools\src\Commands\MigrateToolsCommands.php(413): Drupal\migrate_tools\Commands\MigrateToolsCommands->executeMigration(Object(Drupal\migrate\Plugin\Migration), 'd7_views_migrat...', Array)
#22 [internal function]: Drupal\migrate_tools\Commands\MigrateToolsCommands->import('d7_views_migrat...', Array)
#23 C:\xampp\htdocs\sgbf\vendor\consolidation\annotated-command\src\CommandProcessor.php(257): call_user_func_array(Array, Array)
#24 C:\xampp\htdocs\sgbf\vendor\consolidation\annotated-command\src\CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#25 C:\xampp\htdocs\sgbf\vendor\consolidation\annotated-command\src\CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#26 C:\xampp\htdocs\sgbf\vendor\consolidation\annotated-command\src\AnnotatedCommand.php(390): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#27 C:\xampp\htdocs\sgbf\vendor\symfony\console\Command\Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#28 C:\xampp\htdocs\sgbf\vendor\symfony\console\Application.php(1039): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#29 C:\xampp\htdocs\sgbf\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))
#30 C:\xampp\htdocs\sgbf\vendor\symfony\console\Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#31 C:\xampp\htdocs\sgbf\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))
#32 C:\xampp\htdocs\sgbf\vendor\drush\drush\src\Runtime\Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#33 C:\xampp\htdocs\sgbf\vendor\drush\drush\drush.php(77): Drush\Runtime\Runtime->run(Array)
#34 C:\xampp\htdocs\sgbf\vendor\drush\drush\drush(4): require('C:\\xampp\\htdocs...')
#35 {main}.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

1.2

Component

Code

Created by

🇵🇰Pakistan Qaiser iqbal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Qaiser iqbal
  • 🇳🇿New Zealand quietone

    Congratulations on migrating your site from Drupal 7!

    Unfortunately, for you situation but Drupal core does not provide a migration path for views, it is provided by contributed modules. There is some information about views on the Known issues page . So, I am moving this to the view migration queue where you should be able to get support.

    There are also other Drupal sources of support . I know that the #migration channel in Drupal Slack is very active.

    This does not meet the criteria of a critical so I am changing to normal. This may be a Support Request (it reads as such) but I don't know enough about views_migration, so leaving as a bug.

    Good luck!

  • 🇮🇳India Jeya sundhar Coimbatore

    Hi @Qaiser iqbal,
    Will you share your exported view (D7) for reference to fix this issue.

    Thank you,
    Jeya Sundharam

Production build 0.71.5 2024