From eed8c81fe3197867d83c6ff6901ca76adc236fb0 Mon Sep 17 00:00:00 2001 From: Shawn Kwang Date: Tue, 15 Jan 2019 15:49:55 -0600 Subject: [PATCH] Drupal: Fixed misc PHP problems Fixed some misc PHP problems found with xdebug. --- .../sites/default/boinc/modules/boincuser/boincuser.module | 6 ++++-- drupal/sites/default/boinc/themes/boinc/template.php | 1 + .../sites/default/boinc/themes/boinc/templates/page.tpl.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drupal/sites/default/boinc/modules/boincuser/boincuser.module b/drupal/sites/default/boinc/modules/boincuser/boincuser.module index ae70017ddd..a1b864695f 100644 --- a/drupal/sites/default/boinc/modules/boincuser/boincuser.module +++ b/drupal/sites/default/boinc/modules/boincuser/boincuser.module @@ -303,7 +303,7 @@ function boincuser_user($op, &$edit, &$account, $category = NULL) { require_boinc('password_compat/password'); // Handle BOINC integration for users with UID > 1 (skip anonymous and admin) - if ($account->uid > 1) { + if (isset($account->uid) && ($account->uid > 1)) { switch($op) { case 'load': // User loading; insert BOINC data into the user object @@ -1406,7 +1406,9 @@ function boincuser_token_list($type = 'all') { * Implementation of hook_views_pre_execute() */ function boincuser_views_pre_execute(&$view) { - $account_id = $view->args[0]; + if ($view->args) { + $account_id = $view->args[0]; + } if ($view->name=="user_activity") { // Run the following custom query for the user_activity view $view->build_info['query']= " diff --git a/drupal/sites/default/boinc/themes/boinc/template.php b/drupal/sites/default/boinc/themes/boinc/template.php index e6079d0f05..9dfa014e40 100644 --- a/drupal/sites/default/boinc/themes/boinc/template.php +++ b/drupal/sites/default/boinc/themes/boinc/template.php @@ -81,6 +81,7 @@ function boinc_theme(&$existing, $type, $theme, $path) { * Adjust the rendering of the menu */ function boinc_links__system_main_menu($links, $menu, $element) { + $html = ''; $html .= '