Duplicative generated migration group causes uncaught error at review stage EntityStorageException

Created on 25 September 2023, over 1 year ago

Problem/Motivation

Setting up two imports in a row, the second one will also suggest "my_wordpress" as "ID to assign to the generated migration group" at /admin/structure/migrate/wordpress_migrate/review?js=nojs review stage
Then you click thru and it hits an ugly fatal error.

Steps to reproduce

Easily done with loading two WP exports.

Proposed resolution

Make it catch the error and bring you back to this page. (or it could spit a suggestion with a number, but it should still catch the identical ID one regardless)

Remaining tasks

  • Compare to existing ones on form submissions
  • check for existing one before giving suggested name

User interface changes

Change to flow of form.

API changes

May need new check-for-existing-migration-group function or use an existing function. Also catching this could be validated with tests.

The website encountered an unexpected error. Please try again later.

Drupal\Core\Entity\EntityStorageException: 'migration_group' entity with ID 'my_wordpress' already exists. in Drupal\Core\Entity\EntityStorageBase->doPreSave() (line 519 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).

Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 253)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 339)
Drupal\Core\Entity\EntityBase->save() (Line: 608)
Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 109)
Drupal\wordpress_migrate\WordPressMigrationGenerator->createMigrations() (Line: 85)
Drupal\wordpress_migrate_ui\Wizard\ImportWizard->finish(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 595)
Drupal\Core\Form\FormBuilder->processForm('wordpress_migrate_review_form', Array, Object) (Line: 323)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 57)
Drupal\ctools\Wizard\WizardFactory->getWizardForm(Object, Array, ) (Line: 85)
Drupal\ctools\Controller\WizardFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 686)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇺🇸United States hongpong Philadelphia

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024