Problem/Motivation

It seems that the 'Include translations?' checkbox doesn't always refresh the exported content in the yaml editor textfield correctly, so that it doesn't include the translations.
It does correctly work for the download buttons.

Steps to reproduce

1. Create some content.
2. Add a translation of the content.
3. Export the content.
4. Turn on the checkbox 'Include translations?'
5. Check the exported content in the textfield.

Workaround

By checking the box on, off and back on, it does seem to refresh the content correctly. If this doesn't work for you, try checking the box off and on a couple of times more, until it correctly refreshes the content.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

artycal created an issue. See original summary.

artycal’s picture

Assigned: Unassigned » artycal
reszli’s picture

I was able to reproduce this issue

the problem seems to be related to caching of the output,
since the cache key does not consider the translation flag value

  protected function generateCacheKey(FieldableEntityInterface $entity): string {
    return implode('-', [$entity->getEntityTypeId(), $entity->uuid()]);
  }

while it should, like this:

  protected function generateCacheKey(FieldableEntityInterface $entity): string {
    $hasTranslations = $this->extractTranslationsMode ? 'has_trans' : 'no_trans';
    return implode('-', [$entity->getEntityTypeId(), $entity->uuid(), $hasTranslations]);
  }

nginex’s picture

Assigned: artycal » nginex
Status: Active » Needs review

  • artycal committed fd1df0e on 1.3.x authored by reszli
    [#3282207] Update cache key to include translation flag
    
artycal’s picture

Status: Needs review » Fixed

Thanks for the fix!

artycal’s picture

Assigned: nginex » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.