'Node Translation' page (node/[nid]/translation) doesn't have any 'TMGMT' controls (checkboxes, 'Add to cart' button, 'Request translation' button, etc.) in case if 'Block' module is deactivated (please see attached screenshots). So basically 'TMGMT' module has implicit dependency to 'Block' module.

It happens because 'TMGMT' module alters 'Node Translation' page only if $page['content']['system_main']['translation_node_overview'] or $page['content']['system_main']['content']['translation_node_overview'] variables exist (see tmgmt_node_ui_page_alter()
function). But if 'Block' module is deactivated and there are no other modules that init $page['content']['system_main'] the 'TMGMT' doesn't alter 'Node Translation' page.

One of the way to fix it is to implement tmgmt_page_build() hook (please see the patch in attachment). This solution is far from ideal one but it is just a suggestion.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Yeah, this is a known issue, see https://www.drupal.org/node/1691772, although so far we've only seen it when the main block was misconfigured. Obviously it happens to when block isn't even enabled.

trekhleb’s picture

Component: User interface » Source: Node
trekhleb’s picture

Thank you for the link, Berdir :) We don't use 'Block' module in our current installation. So for now the issue has been fixed in our project by creating a kind of 'fixer' feature that has its own HOOK_page_build() with the following code:

if (empty($page['content']['system_main']) && preg_match('|^node/[0-9]+/translate$|i', current_path())) {
  $page['content']['system_main'] = drupal_set_page_content();
}

But it would be nice to get rid of it in the future :)

Berdir’s picture

Yeah, I'm not sure what a good solution would be. We tried to avoid altering the menu callback because i18n_node already does that, so that will get complicated very quickly.

IIRC, in the Drupal 8 port, I switched to that approach.

jlnd’s picture

I had this issue as well, but in my case the Block module is enabled. There must be some other module that is interfering for me. In any case the patch worked for me. Thanks @trekhleb.

Berdir’s picture

See comment #1, you probably don't have a main content block. You should add one, your site only works because of a safety net.

jlnd’s picture

Berdir, that was it! I'm sorry. I feel like an amateur. I had checked those settings for our front-end theme, but not our back-end theme, which of course is where it matters. Thanks!

kbrinner’s picture

I have run through the installation and setup instructions for TMGMT (trying it out with Google Translate) but I'm still not seeing any of the TMGMT controls. I checked the block config at structure ->blocks -> Main page content, and we don't have anything unusual set up here - set to show on all pages (not restricted) and it's not restricted on content types or any other visibility settings. Any other thoughts about what might be interfering with the display of the controls?

jlnd’s picture

kbrinner, have you checked permissions (/admin/people/permissions) ?

kbrinner’s picture

I was doing all of this as the main site administrator so I didn't think to check permissions - just assumed I had all possible permissions. Unfortunately I have rolled back my db to try using entity translation without translation management toolkit so I can't check to see if there were some permissions that needed to be changed. If in the future I try the toolkit again I will double check permissions. Thank you for your quick response.