Call to a member function getAlias on null in PathItem->postSave()

Created on 27 April 2021, over 3 years ago
Updated 6 August 2024, 5 months ago

I am trying to migrate some nodes with drupal Migrate API.
More specifically, I am trying to update some nodes (incremental migration) and change their language from undefined to English (site default lang).
And I am getting the following error:

[error]  Error: Call to a member function getAlias() on null in Drupal\path\Plugin\Field\FieldType\PathItem->postSave() (line 88 of /web-pub/cedefop/webapp/web/core/modules/path/src/Plugin/Field/FieldType/PathItem.php) #0 /web-pub/cedefop/webapp/web/modules/contrib/pathauto/src/PathautoItem.php(34): Drupal\path\Plugin\Field\FieldType\PathItem->postSave()
#1 [internal function]: Drupal\pathauto\PathautoItem->postSave()
#2 /web-pub/cedefop/webapp/web/modules/contrib/pathauto/src/PathautoFieldItemList.php(25): call_user_func_array()
#3 /web-pub/cedefop/webapp/web/core/lib/Drupal/Core/Field/FieldItemList.php(198): Drupal\pathauto\PathautoFieldItemList->delegateMethod()
#4 [internal function]: Drupal\Core\Field\FieldItemList->postSave()
#5 /web-pub/cedefop/webapp/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(888): call_user_func_array()
#6 /web-pub/cedefop/webapp/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(920): Drupal\Core\Entity\ContentEntityStorageBase->invokeFieldMethod()
#7 /web-pub/cedefop/webapp/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(846): Drupal\Core\Entity\ContentEntityStorageBase->invokeFieldPostSave()
#8 /web-pub/cedefop/webapp/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(535): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
#9 /web-pub/cedefop/webapp/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(735): Drupal\Core\Entity\EntityStorageBase->doPostSave()
#10 /web-pub/cedefop/webapp/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(460): Drupal\Core\Entity\ContentEntityStorageBase->doPostSave()
#11 /web-pub/cedefop/webapp/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(837): Drupal\Core\Entity\EntityStorageBase->save()
#12 /web-pub/cedefop/webapp/web/core/lib/Drupal/Core/Entity/EntityBase.php(395): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#13 /web-pub/cedefop/webapp/web/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php(214): Drupal\Core\Entity\EntityBase->save()
#14 /web-pub/cedefop/webapp/web/core/modules/migrate/src/Plugin/migrate/destination/EntityContentComplete.php(125): Drupal\migrate\Plugin\migrate\destination\EntityContentBase->save()
#15 /web-pub/cedefop/webapp/web/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php(174): Drupal\migrate\Plugin\migrate\destination\EntityContentComplete->save()
#16 /web-pub/cedefop/webapp/web/core/modules/migrate/src/MigrateExecutable.php(230): Drupal\migrate\Plugin\migrate\destination\EntityContentBase->import()
#17 /web-pub/cedefop/webapp/vendor/drush/drush/includes/drush.inc(206): Drupal\migrate\MigrateExecutable->import()
#18 /web-pub/cedefop/webapp/vendor/drush/drush/includes/drush.inc(197): drush_call_user_func_array()
#19 /web-pub/cedefop/webapp/web/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php(846): drush_op()
#20 [internal function]: Drupal\migrate_tools\Commands\MigrateToolsCommands->executeMigration()
#21 /web-pub/cedefop/webapp/web/modules/contrib/migrate_tools/src/Commands/MigrateToolsCommands.php(319): array_walk()
#22 [internal function]: Drupal\migrate_tools\Commands\MigrateToolsCommands->import()
#23 /web-pub/cedefop/webapp/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()

I understand that changing the nodes' language might result in losing the path alias and I am handling it with a custom script running after the migration.
Shouldn't the Drupal core path module check if $path_alias is null before accessing its functions?

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component
MigrationΒ  β†’

Last updated 3 days ago

Created by

πŸ‡¬πŸ‡·Greece mariaioann

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

Merge Requests

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