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
Comment #1
drupalninja99 commentedHere is one problem, the module_invoke needs to be block_info not block (which was the D6 way).
Comment #2
drupalninja99 commentedOK 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
Comment #3
drupalninja99 commentedOK $separator wasn't defined, needs to be -
$separator = I18N_MENU_NODE_BLOCK_SEPARATOR;Attaching patch v3
Comment #4
drupalninja99 commentedShooting 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.
Comment #5
drupalninja99 commentedThe 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.
Comment #6
andrewc.swanson commentedThanks @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?
Comment #7
drupalninja99 commentedI 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.
Comment #8
andrewc.swanson commentedI 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.