Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Commit 9e9a335

Browse files
author
deadlybutter
committed
Adds support for users not logged in
1 parent 9cf0569 commit 9e9a335

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/themes/dosomething/paraneue_dosomething/includes/preprocess.inc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ function paraneue_dosomething_preprocess_page(&$vars) {
152152
);
153153
// If there's a subtitle field on this node, send it to the header
154154
global $user;
155-
$language = $user->language;
155+
if ($user->uid) {
156+
$language = $user->language;
157+
}
158+
else {
159+
$code = dosomething_global_get_current_country_code();
160+
$language = dosomething_global_convert_country_to_language($code);
161+
}
156162
$field_data = dosomething_helpers_extract_field_data($vars['node']->field_subtitle, $language);
157163
if (isset($field_data)) {
158164
$header_vars['subtitle'] = $field_data;

0 commit comments

Comments
 (0)