- ๐บ๐ธUnited States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request โ as a guide.
Did not test
Moving to NW for test cases
- fathima.asmat London, UK
#29 doesn't work for me when translating taxonomy or node field labels. Technically clearing
entity_field.manager
cache should do the trick, however it does not unfortunately. Only the combination of clearing render, page cache along with the entity field manager work for me. Though I don't like this workaround, I'm using this as an interim solution for my projects until a proper fix is released.I have got these in
config_translation/src/Form/ConfigTranslationFormBase.php
:\Drupal::service('entity_field.manager')->clearCachedFieldDefinitions(); \Drupal::service('plugin.cache_clearer')->clearCachedDefinitions(); \Drupal::service('cache.render')->invalidateAll(); \Drupal::service('cache.dynamic_page_cache')->invalidateAll();
Attached a patch if anyone wants to use the workaround for now.
- ๐บ๐ธUnited States smustgrave
Was previously tagged for tests which still needs to happen. Not ready for review.
- ๐ฎ๐ณIndia mohit_aghera Rajkot
I got the slightly different results with the test case.
Cache was not invalidated with the services used in #33 or #36I was able to make it work using following cache invalidation
\Drupal::service('cache.dynamic_page_cache')->invalidateAll(); \Drupal::service('cache.render')->invalidateAll(); \Drupal::service('cache.discovery')->invalidateAll(); \Drupal::service('cache.page')->invalidateAll();
I feel that invalidating the cache that way isn't a good idea.
Probably we should emit the cache tags related to field_instance config whenever title is visible and invalidate those cache tags.I tried to do that, however, this wasn't working as expected. Tried using following approach:
- Added a dummy cache tag called "field_config" inview()
method ofFormatterBase.php
class.
$elements['#cache']['tags'][] = 'field_config';
- Later in
ConfigTranslationFormBase.php
'ssubmit()
callback, I tried to invalidate cache tag along with discovery cache. See following snippet.Cache::invalidateTags(['field_config']); \Drupal::cache('discovery')->invalidate('entity_bundle_field_definitions:node:article:fr');
Since this isn't a generic approach, I haven't added that in the patch. Because all the configurations are not field config etc.
Probably someone more experienced with configuration api/translation API can chime in and throw other ideas.Meanwhile, I've added a test-only patch so others can validate that when we do further work.
This is failing for me on local.Keeping this in needs work since the discussion related to approach is required.
- last update
over 1 year ago 29,277 pass, 4 fail