Problem

Currently to check whether an bundle is enabled for translation we have first to call entity_translation_enabled() and only then entity_translation_enabled_bundle(). This is a cumbersome DX and often leads to missing bundle-level translatability checks.

Proposed solution

We should merge the two functions and specify the entity bundle as an optional second parameter of entity_translation_enabled(). This is a non-backward compatible API change but a quick check on drupalcode.org revealed that no one is using the $skip_handler parameter outside ET.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Priority: Normal » Major
Status: Active » Needs review
FileSize
10.49 KB

Status: Needs review » Needs work

The last submitted patch, et-bundle_check-1947764-1.patch, failed testing.

plach’s picture

Status: Needs work » Needs review
FileSize
10.46 KB

Small improvement in the views translate link hunk.

Status: Needs review » Needs work

The last submitted patch, et-bundle_check-1947764-2.patch, failed testing.

plach’s picture

Status: Needs work » Needs review
FileSize
0 bytes

This one should work.

plach’s picture

(sigh)

plach’s picture

Status: Needs review » Reviewed & tested by the community

I'm going to commit this soon.

plach’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed.

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

  • Commit 774312a on 7.x-1.x, factory, et-fc, revisions by plach:
    Issue #1947764 by plach: Improve bundle translatability checks.
    

  • Commit 774312a on 7.x-1.x, factory, et-fc, revisions, workbench by plach:
    Issue #1947764 by plach: Improve bundle translatability checks.