Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 581e95a

Browse files
author
Michael Grauer
committed
BUG: refs #0381. Cleaned out error supression.
Since we have error reporting turned on for STRICT, and we are setting fields on a field that itself has not yet been created, we were generating error messages. By explicitly creating the field if the field does not yet exist, the error message isn't generated, thus error supression can be removed.
1 parent 25cb6bc commit 581e95a

File tree

6 files changed

+71
-14
lines changed

6 files changed

+71
-14
lines changed

core/GlobalController.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ public function loadElements()
176176
{
177177
$nameComponent = $component . "Component";
178178
Zend_Loader::loadClass($nameComponent, BASE_PATH . '/core/controllers/components');
179-
@$this->Component->$component = new $nameComponent();
179+
if(!isset($this->Component))
180+
{
181+
$this->Component = new stdClass();
182+
}
183+
$this->Component->$component = new $nameComponent();
180184
}
181185
}
182186

@@ -188,7 +192,12 @@ public function loadElements()
188192
$nameForm = $forms . "Form";
189193

190194
Zend_Loader::loadClass($nameForm, BASE_PATH . '/core/controllers/forms');
191-
@$this->Form->$forms = new $nameForm();
195+
196+
if(!isset($this->Form))
197+
{
198+
$this->Form = new stdClass();
199+
}
200+
$this->Form->$forms = new $nameForm();
192201
}
193202
}
194203
}//end loadElements

core/models/GlobalDao.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ public function loadElements()
4949
{
5050
$nameComponent = $component . "Component";
5151
Zend_Loader::loadClass($nameComponent, BASE_PATH . '/core/controllers/components');
52-
@$this->Component->$component = new $nameComponent();
52+
if(!isset($this->Component))
53+
{
54+
$this->Component = new stdClass();
55+
}
56+
$this->Component->$component = new $nameComponent();
5357
}
5458
}
5559
}

core/models/MIDASModel.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ public function loadElements()
9898
$nameComponent = $component . "Component";
9999

100100
Zend_Loader::loadClass($nameComponent, BASE_PATH . '/core/controllers/components');
101-
@$this->Component->$component = new $nameComponent();
101+
if(!isset($this->Component))
102+
{
103+
$this->Component = new stdClass();
104+
}
105+
$this->Component->$component = new $nameComponent();
102106
}
103107
}
104108
}

core/models/MIDASUpgrade.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ public function loadModuleElements()
9494
{
9595
$nameComponent = ucfirst($this->moduleName).'_'.$component . "Component";
9696
include_once (BASE_PATH . "/modules/".$this->moduleName."/controllers/components/".$component."Component.php");
97-
@$this->ModuleComponent->$component = new $nameComponent();
97+
if(!isset($this->ModuleComponent))
98+
{
99+
$this->ModuleComponent = new stdClass();
100+
}
101+
$this->ModuleComponent->$component = new $nameComponent();
98102
}
99103
}
100104

@@ -104,7 +108,11 @@ public function loadModuleElements()
104108
{
105109
$nameForm = ucfirst($this->moduleName).'_'.$forms . "Form";
106110
include_once (BASE_PATH . "/modules/".$this->moduleName."/controllers/forms/".$forms."Form.php");
107-
@$this->ModuleForm->$forms = new $nameForm();
111+
if(!isset($this->ModuleForm))
112+
{
113+
$this->ModuleForm = new stdClass();
114+
}
115+
$this->ModuleForm->$forms = new $nameForm();
108116
}
109117
}
110118
}
@@ -143,7 +151,11 @@ public function loadElements()
143151
{
144152
$nameComponent = $component . "Component";
145153
Zend_Loader::loadClass($nameComponent, BASE_PATH . '/core/controllers/components');
146-
@$this->Component->$component = new $nameComponent();
154+
if(!isset($this->Component))
155+
{
156+
$this->Component = new stdClass();
157+
}
158+
$this->Component->$component = new $nameComponent();
147159
}
148160
}
149161

@@ -155,7 +167,11 @@ public function loadElements()
155167
$nameForm = $forms . "Form";
156168

157169
Zend_Loader::loadClass($nameForm, BASE_PATH . '/core/controllers/forms');
158-
@$this->Form->$forms = new $nameForm();
170+
if(!isset($this->Form))
171+
{
172+
$this->Form = new stdClass();
173+
}
174+
$this->Form->$forms = new $nameForm();
159175
}
160176
}
161177
}//end loadElements

modules/GlobalModule.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ public function loadModuleElements()
118118
{
119119
$nameComponent = ucfirst($this->moduleName).'_'.$component . "Component";
120120
include_once (BASE_PATH . "/modules/".$this->moduleName."/controllers/components/".$component."Component.php");
121-
@$this->ModuleComponent->$component = new $nameComponent();
121+
if(!isset($this->ModuleComponent))
122+
{
123+
$this->ModuleComponent = new stdClass();
124+
}
125+
$this->ModuleComponent->$component = new $nameComponent();
122126
}
123127
}
124128

@@ -128,7 +132,11 @@ public function loadModuleElements()
128132
{
129133
$nameForm = ucfirst($this->moduleName).'_'.$forms . "Form";
130134
include_once (BASE_PATH . "/modules/".$this->moduleName."/controllers/forms/".$forms."Form.php");
131-
@$this->ModuleForm->$forms = new $nameForm();
135+
if(!isset($this->ModuleForm))
136+
{
137+
$this->ModuleForm = new stdClass();
138+
}
139+
$this->ModuleForm->$forms = new $nameForm();
132140
}
133141
}
134142
}

notification/GlobalNotification.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ public function loadElements()
115115
{
116116
$nameComponent = $component . "Component";
117117
Zend_Loader::loadClass($nameComponent, BASE_PATH . '/core/controllers/components');
118-
@$this->Component->$component = new $nameComponent();
118+
if(!isset($this->Component))
119+
{
120+
$this->Component = new stdClass();
121+
}
122+
$this->Component->$component = new $nameComponent();
119123
}
120124
}
121125

@@ -127,7 +131,11 @@ public function loadElements()
127131
$nameForm = $forms . "Form";
128132

129133
Zend_Loader::loadClass($nameForm, BASE_PATH . '/core/controllers/forms');
130-
@$this->Form->$forms = new $nameForm();
134+
if(!isset($this->Form))
135+
{
136+
$this->Form = new stdClass();
137+
}
138+
$this->Form->$forms = new $nameForm();
131139
}
132140
}
133141
}//end loadElements
@@ -167,7 +175,11 @@ public function loadModuleElements()
167175
{
168176
$nameComponent = ucfirst($this->moduleName).'_'.$component . "Component";
169177
include_once (BASE_PATH . "/modules/".$this->moduleName."/controllers/components/".$component."Component.php");
170-
@$this->ModuleComponent->$component = new $nameComponent();
178+
if(!isset($this->ModuleComponent))
179+
{
180+
$this->ModuleComponent = new stdClass();
181+
}
182+
$this->ModuleComponent->$component = new $nameComponent();
171183
}
172184
}
173185

@@ -177,7 +189,11 @@ public function loadModuleElements()
177189
{
178190
$nameForm = ucfirst($this->moduleName).'_'.$forms . "Form";
179191
include_once (BASE_PATH . "/modules/".$this->moduleName."/controllers/forms/".$forms."Form.php");
180-
@$this->ModuleForm->$forms = new $nameForm();
192+
if(!isset($this->ModuleForm))
193+
{
194+
$this->ModuleForm = new stdClass();
195+
}
196+
$this->ModuleForm->$forms = new $nameForm();
181197
}
182198
}
183199
}

0 commit comments

Comments
 (0)