-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #3384 Add thumbnail image to Trellis Event importer #3761
base: main
Are you sure you want to change the base?
Conversation
Implemented @joeparsons suggestion of performing media download during a Queue task. |
I like it! As we discussed, it would be cool if we could figure out a programmatically trigger a cron run in the background at the end of the migration but the possibilities for that look complicated. Having to wait for the next cron run definitely wouldn't be the end of the world IMHO. We'll probably just want to make sure to include a notice or some help text that indicates that more processing will happen later and probably update our Trellis Events documentation about this. |
* @QueueWorker( | ||
* id = "az_deferred_media", | ||
* title = @Translation("Quickstart Deferred Media"), | ||
* cron = { | ||
* "time" = 30, | ||
* }, | ||
* ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @QueueWorker( | |
* id = "az_deferred_media", | |
* title = @Translation("Quickstart Deferred Media"), | |
* cron = { | |
* "time" = 30, | |
* }, | |
* ) | |
#[QueueWorker( | |
id: 'az_deferred_media', | |
title: new TranslatableMarkup('Quickstart Deferred Media'), | |
cron: ['time' => 30] | |
)] |
Looks like QueueWorker plugins have been converted to attributes as of 10.3.0: https://www.drupal.org/node/3229001
|
||
use Drupal\Component\Utility\Crypt; | ||
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | ||
use Drupal\Core\Queue\QueueWorkerBase; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use Drupal\Core\Queue\QueueWorkerBase; | |
use Drupal\Core\Queue\Attribute\QueueWorker; | |
use Drupal\Core\Queue\QueueWorkerBase; |
Description
One limitation of our method of running migrations via the Batch UI is that it doesn't seem that multiple dependent migrations can easily be run. This is not ideal for purposes of media migrations, because normally nodes with media need a way to run dependent migrations to create their dependent media entities and files.
This PR introduces an experimental process plugin that inline creates media and file entities. To determine if the file has changed, it is compared to the existing value via hash value.
This PR is labeled a draft because, while feature complete, I think there are some remaining questions about implementation:
For review:
Related issues
#3384
#3362 (Similar functionality is needed)
How to test
az_event_trellis
andaz_enterprise_attributes_import
/admin/trellis-event-importer
Types of changes
Arizona Quickstart (install profile, custom modules, custom theme)
Drupal core
Drupal contrib projects
Checklist