Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Field translation
This field is shared among the entity translations. Enable translation
Comment | File | Size | Author |
---|---|---|---|
#6 | entity_translation-field_translation_process_drush-1800530-6.patch | 3.64 KB | pvhee |
Comments
Comment #1
drzraf CreditAttribution: drzraf commentedthis is a stub for this and #1800158: Entity Translation Upgrade, drush extension..
This does not work, for a reason or another.
Tricking forms could be painful. Let's hope someone could jump into this.
Comment #2
plachComment #3
drzraf CreditAttribution: drzraf commentedThis is really a stub, it uses the form API upon which ET admin is built.
So these drush commands correctly register batches, but I don't know the right way to trigger them, either automatically or manually from drush. Neither I know how to grab the output continuously in order to give a feedback about the running process.
Comment #4
drzraf CreditAttribution: drzraf commentedthe patch needs love from someone who knows how to trigger batches from drush.
Comment #5
Owen Barton CreditAttribution: Owen Barton commentedTriggering batches from Drush is pretty straightforward - just set your batch as usual (via the form, or directly based on command args), then call drush_backend_batch_process(); which will process it in batches, using a separate process for each (even on the CLI, memory can be an issue with long running processes).
For details see:
https://drupal.org/node/873132 and http://drupalcontrib.org/api/drupal/contributions%21drush%21includes%21b...
Comment #6
pvhee CreditAttribution: pvhee commentedI wrote a patch from scratch to address the same issue: use drush to enable field translation for a given field.
My use case is the following: we enable field translation for a given field, and we make the changes in the exported field settings. When we deploy these changes, the field translation changes are changed but the data is not processed. We'd use the given drush command to process these field changes.
The patch does the following:
Usage of the drush command:
drush entity-translation-process-field-translation field_name
with "field_name" replaced with your field machine name.
Comment #7
pvhee CreditAttribution: pvhee commentedSetting to needs review.
Comment #8
eelkeblokWhile doing my own custom drush work I ran into a memory usage issue. The reason seems to be that drush will run all batch operations in a single run, and the enity_load static cache will blow up the memory usage of the process. This is no issue for the existing usage of the function as the regular Batch API will do many http requests. Mostly since I only found this issue just now, but also because it might be useful for others doing their own custom drush work, I've created a separate issue for this. However, I would say that for this issue to make it into the module, that one is quite essential as well. #2709211: Make entity_translation_translatable_batch() more drush friendly.
FWIW, I think the patches in this issues do not take into account the scenario where the field will already be configured to be translatable (e.g. through Features), but still need to have their content migrated. I'd say this patch would become a lot more useful if it allows for that scenario as well (this is the scenario I've been working on).