function i18n_menu_node_block_module_info($module = NULL) {
  static $info;

  if (!isset($info)) {
    $info = array(
      'menu' => array(
        'view' => 'i18n_menu_node_menu_block_view',
      ),
      'user' => array(
        'delta' => array(1),
        'view' => 'i18n_menu_node_navigation_menu_block_view',
      ),
      'menu_block' => array(),

Does array() mean menu_block isn't supported?

function i18n_menu_node_block_info() {
  $blocks = array();

  $schema = drupal_get_schema('blocks');
  $max_length = $schema['fields']['delta']['length'];
  
  // Retrieve blocks from all the modules defined in the block information.
  foreach (i18n_menu_node_block_module_info() as $module => $data) {
    $module_blocks = module_invoke($module, 'block');
    if (!empty($module_blocks)) {

Also I see that $module_blocks is always empty. Is module_invoke($module, 'block'); the right function call to get a modules block information?

Comments

drupalninja99’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new856 bytes

Here is one problem, the module_invoke needs to be block_info not block (which was the D6 way).

drupalninja99’s picture

StatusFileSize
new959 bytes

OK found another issue, $schema = drupal_get_schema('blocks'); needs to be $schema = drupal_get_schema('block');

Now I have the i18n blocks correctly displaying for me on the main block screen. Attaching updated patch

drupalninja99’s picture

StatusFileSize
new1007 bytes

OK $separator wasn't defined, needs to be - $separator = I18N_MENU_NODE_BLOCK_SEPARATOR;

Attaching patch v3

drupalninja99’s picture

StatusFileSize
new1.77 KB

Shooting fish in a barrel right now. The i18n_menu_node_block_view() function tries to invoke the default block view the D6 way. I fixed it for D7. Now my block shows up when embedded.

drupalninja99’s picture

The i18n_select(FALSE); and i18n_select(TRUE); calls don't see to have any effect on my menu block which follows the active menu item selected. Could be a menu_block problem though.

andrewc.swanson’s picture

Thanks @drupalninja99; it appears that your patch fixes the problem.

However we didn't use the menu_block integration on our project with this module and I'm unsure of the functionality it is trying to provide. I have included the default menu block and the i18n version on a site, but they both show the same translated menu items. What additional features is the i18n version intended to have?

drupalninja99’s picture

I don't really need this any more. I patched the menu_block module to fix the issue with 'following' the active menu item. I think I still use other features of this module, just not the block piece. I do think my last patch works though.

andrewc.swanson’s picture

Status: Patch (to be ported) » Closed (fixed)

I have committed your patch in #4. I'm not sure if it resolves all issues with the block implementation, but it does get the i18n block to show up.