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.
(This only occurs with entity revision scheduler enabled.) ET's language fallback must be turned off as well.
To repro:
- enable ERS, configure site for translation
- disable language fallback at admin/config/regional/entity_translation
- create and "Save and Publish" a new piece of content that is translation enabled (node or field translation)
- view the content as an anonymous user (not logged in)
- observe a warning
Comment | File | Size | Author |
---|---|---|---|
#1 | entity_translation-anon-users-cant-see-content-1789558.patch | 499 bytes | ethanethan |
Comments
Comment #1
ethanethan CreditAttribution: ethanethan commentedLooked like the status field in entity_translation is important for the visibility to anonymous users. This fix reads the published state off the entity in question and applies it to the entity as its stored in entity_translation.
Is this a good fix?
Comment #2
plachNot every entity defines a status property: you may want to try
$this->getStatus()
. Also, indenting tabs should be replaced with spaces.However I don't think this is the right fix since it's basically ignoring the status set in the translation record.
Comment #3
ethanethan CreditAttribution: ethanethan commentedHm, ok thanks for the quick reply. Any pointers on how to solve this? Or where to look? Where is the $entity->translations set and modified?
Comment #4
ethanethan CreditAttribution: ethanethan commentedDid some more work on Friday-- here's the fix that has worked for us. Just adds a listener to the ERS form which publishes the content. Since only the source node in the translation set is invisible to anon users, only that one is updated: