Status field incorrectly disabled for new translations

Created on 10 April 2019, over 5 years ago
Updated 31 January 2023, over 1 year ago

There is a bug in the logic which decides to prevent the user from unchecking the Publish this translation checkbox.

<!--break-->

What are the steps required to reproduce this bug?

  1. Create a media entity and save it as published
  2. Create a translation of the entity

What behavior were you expecting?

First of all, I wasn't expecting to see the Publish this translation checkbox at all, since (in our own case), the content type is connected with a moderation workflow, which takes over control of the status field, but that's a problem which probably needs to be addressed β†’ by the content_moderation module. Another reason I didn't expect to see the checkbox was because it's not there on the form for a node entity (the node module removes that field from the form in an entityFormAlter() method), which is why this repro case specifies a media entity.

Second, I was surprised to see that the default for the checkbox field was checked. But that's just because I haven't yet found the documentation which explains that the default for a new translation of an entity is that it will be published. (If some kind soul could provide the link to that documentation, I'd be grateful).

Third, I did not expect to see that the checkbox was disabled.

What happened instead?

The "Publish this translation" checkbox appears, is checked, and is disabled.

The first two points are provided in order to give a complete answer to the What behavior were you expecting? question, but they're not the bug I'm reporting. The last bit is the bug. The comment in the code indicates that the intention is to prevent removal of the only remaining published translation of an entity, but the code thinks that the translation being saved is published even when it isn't. In fact, you'll run into this same bug whether you set the original-language version of the entity as published or unpublished.

I'll attach a patch as soon as I get an issue number which I can embed in the patch file name.

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
Content translationΒ  β†’

Last updated about 19 hours ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States bkline Virginia

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡Έ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 for issue

    But this will need a valid test case to show the issue.

Production build 0.71.5 2024