mythinking / doophp

Automatically exported from code.google.com/p/doophp
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Access to undeclared static property: DooViewBasic::$safeVariableResult #78

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add {% include page_path %} to page in view directory
2. open from browser 
3. raises "Access to undeclared static property: 
DooViewBasic::$safeVariableResult" error
in this line
if($data['page_path'] != DooViewBasic::$safeVariableResult){

What is the expected output? What do you see instead?
include the page normally without error

What version of the product are you using? On what operating system?
revision 695, Mac OSX 10.6.8 , Apache 2.0

Please provide any additional information below.
its only need to be static 
old:
protected $safeVariableResult = 'null';
fix:
protected static $safeVariableResult = 'null';

Original issue reported on code.google.com by ahmadt89 on 17 Nov 2011 at 2:06

GoogleCodeExporter commented 9 years ago
the fix will effect

 108 if ($defaultValue === null) {
 109 $this->safeVariableResult = 'null';
 111 $this->safeVariableResult = ($defaultValue === true) ? 'true' : 'false';
 113 $this->safeVariableResult = $defaultValue;
 115 $this->safeVariableResult = "'{$defaultValue}'";
 117 $this->safeVariableResult = $defaultValue;
and 
1319 return " ( isset({$result}) ? {$result} : " . $this->safeVariableResult . 
" ) ";

we have to make it static for all to be used in the rendered templates 

Original comment by ahmadt89 on 17 Nov 2011 at 2:28

GoogleCodeExporter commented 9 years ago

Original comment by darkredz on 10 Mar 2012 at 3:35