Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19542 Unable to theme language switcher block #426

Open
wants to merge 1 commit into
base: 7.x-master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions civicrm.module
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,12 @@ function civicrm_metatag_metatags_view_alter(&$output, $instance) {
*
* @return array
*/
function civicrm_links__locale_block($variables) {
function civicrm_preprocess_links__locale_block(&$variables) {
if (arg(0) == 'civicrm') {
foreach ($variables['links'] as $lang => $attr) {
$variables['links'][$lang]['query'] = _civicrm_get_url_parameters();
}
}
return theme('links', $variables);
}

/**
Expand Down Expand Up @@ -951,9 +950,6 @@ function civicrm_user_admin_permissions_submit($form, &$form_state) {
* Make sure this page preprocess function runs last
* so that a theme can't call drupal_get_js().
*
* Also, add civicrm parameters to links so they are not truncated by the
* language switcher.
*
* @param array $theme_registry
* Registry theme metadata.
*/
Expand All @@ -966,9 +962,6 @@ function civicrm_theme_registry_alter(&$theme_registry) {
// Now add it on at the end of the array so that it runs last.
$theme_registry['page']['preprocess functions'][] = 'civicrm_preprocess_page';
}
// Rewrite the links in order to add back CiviCRM parameters for the language switcher.
$theme_registry['links__locale_block']['theme path'] = drupal_get_path('module', 'civicrm');
$theme_registry['links__locale_block']['function'] = 'civicrm_links__locale_block';
}

/**
Expand Down