From 2a8b0bd8deac45a11c50fe43913ab5698a107d9b Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@enhancesoft.com> Date: Tue, 16 Apr 2019 18:26:53 +0000 Subject: [PATCH] Check primary properties first to avoid uncessesary config loading --- include/class.staff.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/class.staff.php b/include/class.staff.php index 2618730bc..7f2392b51 100644 --- a/include/class.staff.php +++ b/include/class.staff.php @@ -69,16 +69,17 @@ implements AuthenticatedUser, EmailContact, TemplateVariable, Searchable { function get($field, $default=false) { + // Check primary fields + try { + return parent::get($field, $default); + } catch (Exception $e) {} + // Autoload config if not loaded already if (!isset($this->_config)) $this->getConfig(); if (isset($this->_config[$field])) return $this->_config[$field]; - - try { - return parent::get($field, $default); - } catch (Exception $e) {} } function getConfig() { -- GitLab