Hi, Inspecting pages.inc in l10n_community, I've noticed that in l10n_community_overview_language (which creates the downloads page) the following lines call the hook l10n_community_overview_language for the modules l10n_groups and l10n_community:

  $content_output1[]['#markup'] = module_invoke('l10n_groups', 'l10n_community_build_language_page', $languages[$langcode]);
  $content_output1[]['#markup'] = module_invoke('l10n_packager', 'l10n_community_build_language_page', $languages[$langcode]);

I was thinking we could replace them with a more generic call so other modules could implement the hook:

  $pages = module_invoke_all('l10n_community_build_language_page', $languages[$langcode]);
  foreach ($pages as $module_page) {
    $content_output[]['#markup'] = $module_page;
  }

What do you think? I can provide a patch if needed.

Cheers.

Comments

lucascaro’s picture

Actually, just to save time in case we decide to do it that way, here's a patch :)

lucascaro’s picture

aafter talking with SebCorbin we decided that it's better if the hook returns a render array so here's a patch using module_implements that makes it look like:

foreach (module_implements('l10n_community_build_language_page') as $module) {
  $content_output[] = module_invoke($module, 'l10n_community_build_language_page', $languages[$langcode]);
}
lucascaro’s picture

Priority: Minor » Normal

Incidentally, this fixed another problem with rendering for the downloads page, so bumping up the priority.

SebCorbin’s picture

Status: Needs review » Fixed

Committed!

Status: Fixed » Closed (fixed)

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