View previous topic :: View next topic |
Author |
Message |
mr-alexander Smarty Rookie
Joined: 23 Apr 2015 Posts: 8
|
Posted: Fri Apr 24, 2015 4:06 am Post subject: Error running smarty |
|
|
Hello,
When I updated the core version of smarty from 2.6.25 to 3.1.21 I get the following error message:
Code: |
ERRNO: 1024
n TEXT: Undefined property: Smarty::$tpl_vars
LOCATION: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/Smarty.class.php, line 738, at April 24, 2015, 12:07 am
Showing backtrace:
trigger_error("Undefined property: Smarty::$tpl_vars", "1024")
# line 738,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/Smarty.class.php
Smarty.__get("tpl_vars")
# line 66,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_templatebase.php
Smarty_Internal_TemplateBase.fetch("blank.tpl", null, null, null, true)
# line 394,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_templatebase.php
Smarty_Internal_TemplateBase.display("blank.tpl")
# line 323,
file: /Applications/XAMPP/xamppfiles/htdocs/site/index.php
ERRNO: 1024
n TEXT: Undefined property: Smarty::$config_vars
LOCATION: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/Smarty.class.php, line 738, at April 24, 2015, 12:07 am
Showing backtrace:
trigger_error("Undefined property: Smarty::$config_vars", "1024")
# line 738,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/Smarty.class.php
Smarty.__get("config_vars")
# line 67,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_templatebase.php
Smarty_Internal_TemplateBase.fetch("blank.tpl", null, null, null, true)
# line 394,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_templatebase.php
Smarty_Internal_TemplateBase.display("blank.tpl")
# line 323,
file: /Applications/XAMPP/xamppfiles/htdocs/site/index.php
|
Any comments on why this is happening?
Help is appreciated. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Apr 24, 2015 12:05 pm Post subject: |
|
|
Did you delete all old compiled and cached template files in the templates_c and cache subfolder after the upgrade? This must be done. |
|
Back to top |
|
mr-alexander Smarty Rookie
Joined: 23 Apr 2015 Posts: 8
|
Posted: Fri Apr 24, 2015 11:13 pm Post subject: |
|
|
Hi U.Tews,
Thanks for the help.
Yes, I have deleted all complied and caches files and subfolders and still the same error.
Any other suggestions? |
|
Back to top |
|
mr-alexander Smarty Rookie
Joined: 23 Apr 2015 Posts: 8
|
Posted: Fri Apr 24, 2015 11:22 pm Post subject: |
|
|
I even tried starting a brand new smarty project and I get the following errors, below.
If interested, I have compressed the folder I am working with, has smarty the templates folders and the index file @ https://www.dropbox.com/s/apbywvtwsl48r39/smarty-test.zip?dl=0
Code: |
Notice: Undefined property: Smarty::$tpl_vars in /Applications/XAMPP/xamppfiles/htdocs/smarty/Smarty.class.php on line 738
Notice: Undefined property: Smarty::$config_vars in /Applications/XAMPP/xamppfiles/htdocs/smarty/Smarty.class.php on line 738
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /Applications/XAMPP/xamppfiles/htdocs/smarty/sysplugins/smarty_internal_templatebase.php on line 70
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /Applications/XAMPP/xamppfiles/htdocs/smarty/sysplugins/smarty_internal_templatebase.php on line 77
Fatal error: Uncaught --> Smarty: template property 'source' does not exist. <-- thrown in /Applications/XAMPP/xamppfiles/htdocs/smarty/sysplugins/smarty_internal_template.php on line 953
|
|
|
Back to top |
|
mr-alexander Smarty Rookie
Joined: 23 Apr 2015 Posts: 8
|
Posted: Fri Apr 24, 2015 11:28 pm Post subject: |
|
|
When I run the testInstall I get the following
Smarty Installation test...
Testing template directory...
/Applications/XAMPP/xamppfiles/htdocs/smarty-test/templates/templates/ is OK.
Testing compile directory...
/Applications/XAMPP/xamppfiles/htdocs/smarty-test/templates/compile/ is OK.
Testing plugins directory...
/Applications/XAMPP/xamppfiles/htdocs/smarty-test/smarty/plugins/ is OK.
Testing cache directory...
/Applications/XAMPP/xamppfiles/htdocs/smarty-test/templates/cache/ is OK.
Testing configs directory...
Warning: is_dir() expects parameter 1 to be string, array given in /Applications/XAMPP/xamppfiles/htdocs/smarty-test/smarty/sysplugins/smarty_internal_utility.php on line 286
FAILED: Array is not a directory.
Tests complete. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Apr 26, 2015 4:38 am Post subject: |
|
|
You are not using the Smarty files from the stable 3.1.21 release.
Smarty 3.1.21 was released on October 2014.
Many files in your sysplugis folder have a newer date and do not belong to version 3.1.21.
You can download the stable versions from here:
https://github.com/smarty-php/smarty/releases |
|
Back to top |
|
mr-alexander Smarty Rookie
Joined: 23 Apr 2015 Posts: 8
|
Posted: Sun Apr 26, 2015 12:16 pm Post subject: |
|
|
Thanks for your help, that fixed it but now the following error is coming up:
Code: |
ERRNO: 2
n TEXT: filemtime() [function.filemtime]: stat failed for /Applications/XAMPP/xamppfiles/htdocs/site/presentation/templates_c/00ad52d5d5c9b5c7171e411b60e124728a1fc66e.file.site_front.tpl.php
LOCATION: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_resource.php, line 772, at April 26, 2015, 8:14 am
Showing backtrace:
filemtime("/Applications/XAMPP/xamppfiles/htdocs/site/presentation/templates_c/00ad52d5d5c9b5c7171e411b60e124728a1fc66e.file.site_front.tpl.php")
# line 772,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_resource.php
Smarty_Template_Source.getCompiled(Object: Smarty_Internal_Template)
# line 700,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_template.php
Smarty_Internal_Template.__get("compiled")
# line 154,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_templatebase.php
Smarty_Internal_TemplateBase.fetch("site_front.tpl", null, null, null, true)
# line 394,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_templatebase.php
Smarty_Internal_TemplateBase.display("site_front.tpl")
# line 323,
file: /Applications/XAMPP/xamppfiles/htdocs/site/index.php
|
|
|
Back to top |
|
mr-alexander Smarty Rookie
Joined: 23 Apr 2015 Posts: 8
|
Posted: Sun Apr 26, 2015 12:19 pm Post subject: |
|
|
When I changed the following file then everything worked:
smarty/sysplugins/smarty_resource.php @ line 772:
Code: |
if( file_exists($compiled->filepath) )
{
$compiled->timestamp = @filemtime($compiled->filepath);
}
else
{
$compiled->timestamp = false;
}
|
Since the file does not exist and I have error reporting turned on it bypasses @.
Any thoughts? |
|
Back to top |
|
mr-alexander Smarty Rookie
Joined: 23 Apr 2015 Posts: 8
|
Posted: Sun Apr 26, 2015 12:27 pm Post subject: |
|
|
By the way, same issue when I try to run cache:
Code: |
n TEXT: filemtime() [function.filemtime]: stat failed for /Applications/XAMPP/xamppfiles/htdocs/site/presentation/templates_cache/00ad52d5d5c9b5c7171e411b60e124728a1fc66e.site_front.tpl.php
LOCATION: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_cacheresource_file.php, line 64, at April 26, 2015, 8:26 am
Showing backtrace:
filemtime("/Applications/XAMPP/xamppfiles/htdocs/site/presentation/templates_cache/00ad52d5d5c9b5c7171e411b60e124728a1fc66e.site_front.tpl.php")
# line 64,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_cacheresource_file.php
Smarty_Internal_CacheResource_File.populate(Object: Smarty_Template_Cached, Object: Smarty_Internal_Template)
# line 359,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_cacheresource.php
Smarty_Template_Cached.__construct(Object: Smarty_Internal_Template)
# line 708,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_template.php
Smarty_Internal_Template.__get("cached")
# line 419,
file: /Applications/XAMPP/xamppfiles/htdocs/site/libs/smarty/sysplugins/smarty_internal_templatebase.php
Smarty_Internal_TemplateBase.isCached("site_front.tpl")
# line 66,
file: /Applications/XAMPP/xamppfiles/htdocs/site/index.php
|
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Apr 26, 2015 8:16 pm Post subject: |
|
|
We had chosen @ error suppression as it had best performance.
If you disable @ error suppression you need to modify the code.
By the way: is_file() seems to be faster as file_exists(); |
|
Back to top |
|
mr-alexander Smarty Rookie
Joined: 23 Apr 2015 Posts: 8
|
Posted: Sun Apr 26, 2015 8:21 pm Post subject: |
|
|
Thank you for the help, greatly appreciated. |
|
Back to top |
|
PeterNovik Smarty n00b
Joined: 27 May 2015 Posts: 1
|
Posted: Wed May 27, 2015 10:54 am Post subject: |
|
|
Wow I had just the same trouble. Now it's ok |
|
Back to top |
|
|