- Merge request !6987Issue #2756269 - Dispatch new events during migration import β (Open) created by achap
- Issue was unassigned.
- Status changed to Needs review
3 months ago 5:52am 11 March 2024 - achap π¦πΊ
6 years later and a need for this came up again.
I think I have addressed most of the issues from #19. I added additional tests for everywhere the migration fails and ensure an event is dispatched. In addition, I passed the original exception to the event since in a few cases MigrateExecutable catches the generic Exception event, which means it will catch all exceptions giving classes further up the stack no chance to react to the event. In my case, a source plugin can throw a SuspendQueueException but this was being caught by MigrateExecutable and not the queue runners. So I needed to re-throw it in my event subscriber.
Removed the additional ideas from the issue summary as they are outside the scope of the core issue. I guess they can be opened in new issues if they're still wanted.
- Status changed to Needs work
3 months ago 3:09pm 15 March 2024 - πΊπΈUnited States smustgrave
Left some feedback, mostly small stuff.
Will still need a change record.
- Status changed to Needs review
3 months ago 4:43am 21 March 2024 - achap π¦πΊ
Have added a change record and made some adjustments based on the comments and also made the getRow method consistent with regards to type hinting/annotations and the rest of the code. Will wait and see regarding the annotations issue.
- πΊπΈUnited States smustgrave
smustgrave β changed the visibility of the branch 11.x to hidden.
- πΊπΈUnited States smustgrave
smustgrave β changed the visibility of the branch drupal-2756269-10.1.x to hidden.
- πΊπΈUnited States smustgrave
smustgrave β changed the visibility of the branch drupal-2756269-10.2.x to hidden.
- Status changed to Needs work
about 2 months ago 3:20pm 24 April 2024 - πΊπΈUnited States smustgrave
Cleaning up patches and unused branches
Sorry this fell off my radar. Everything is looking really good but think the annotations now need to be replaced with attributes. Will keep an eye out for this one.
- achap π¦πΊ
I've converted those annotations to php attributes. Unfortunately when I've merged in the latest code from 11.x there is a test failure in
testRowSkippedEvent
however the error message is obscured by the annoying "Exception: Serialization of 'Closure' is not allowed" message which doesn't actually show what's wrong. When I run MigrateEventsTest.php locally I don't get any errors so this one is hard to debug. Apparently this is quite a common issue faced in Migrate tests (see related issue).I do have a stack trace:
/builds/issue/drupal-2756269/core/lib/Drupal/Core/Cache/MemoryBackend.php:119 /builds/issue/drupal-2756269/core/lib/Drupal/Core/Cache/CacheCollector.php:275 /builds/issue/drupal-2756269/core/lib/Drupal/Core/State/State.php:102 /builds/issue/drupal-2756269/core/modules/migrate/tests/src/Kernel/MigrateEventsTest.php:481 /builds/issue/drupal-2756269/vendor/symfony/event-dispatcher/EventDispatcher.php:206 /builds/issue/drupal-2756269/vendor/symfony/event-dispatcher/EventDispatcher.php:56 /builds/issue/drupal-2756269/core/modules/migrate/src/MigrateExecutable.php:247 /builds/issue/drupal-2756269/core/modules/migrate/tests/src/Kernel/MigrateEventsTest.php:354
That shows that it is trying to serialize the cached data (which would contain an exception). My guess would be that the exception data has a closure in there somewhere but like I said very hard to debug if I can't reproduce it locally.
Hopefully someone can help pinpoint the issue!