1

In my custom entity module I have already defined a status checkbox to determine the entities status. What I noticed is when I enable show_revisions_ui in the annotation and have the entity setup to support multiple languages there are two check boxes at the bottom of the page.

One of them is to publish this entities language copy and as a result the published checkbox I created is being ignored. How can I disable the multilingual published checkbox?

enter image description here

2
  • 1
    Have you tried hook_form_alter already?
    – leymannx
    Dec 18, 2019 at 16:42
  • I checked but only the revisions field had a group labeled advanced. Not sure where that field is coming from.
    – blu
    Dec 18, 2019 at 18:07

1 Answer 1

2

So it turns out I needed to define a translation handler for my entity.

inside of MyEntityTranslationHandler that extends the ContentTranslationHandler I override the entityFormAlter function and add this:

$form['content_translation']['status']['#access'] = FALSE;

1
  • This code really "hides" mentioned checkbox, but it does not stop the previous checkbox beeing ignored. I have tested it on Media entity type. I have disabled $form['content_translation']['status'] access and "status" base field stays ignored. Maybe I am doing somwthing wrong. 2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.