Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Error running smarty

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
mr-alexander
Smarty Rookie


Joined: 23 Apr 2015
Posts: 8

PostPosted: Fri Apr 24, 2015 4:06 am    Post subject: Error running smarty Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Apr 24, 2015 12:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
mr-alexander
Smarty Rookie


Joined: 23 Apr 2015
Posts: 8

PostPosted: Fri Apr 24, 2015 11:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
mr-alexander
Smarty Rookie


Joined: 23 Apr 2015
Posts: 8

PostPosted: Fri Apr 24, 2015 11:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
mr-alexander
Smarty Rookie


Joined: 23 Apr 2015
Posts: 8

PostPosted: Fri Apr 24, 2015 11:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Apr 26, 2015 4:38 am    Post subject: Reply with quote

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
View user's profile Send private message
mr-alexander
Smarty Rookie


Joined: 23 Apr 2015
Posts: 8

PostPosted: Sun Apr 26, 2015 12:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
mr-alexander
Smarty Rookie


Joined: 23 Apr 2015
Posts: 8

PostPosted: Sun Apr 26, 2015 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
mr-alexander
Smarty Rookie


Joined: 23 Apr 2015
Posts: 8

PostPosted: Sun Apr 26, 2015 12:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Apr 26, 2015 8:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
mr-alexander
Smarty Rookie


Joined: 23 Apr 2015
Posts: 8

PostPosted: Sun Apr 26, 2015 8:21 pm    Post subject: Reply with quote

Thank you for the help, greatly appreciated.
Back to top
View user's profile Send private message
PeterNovik
Smarty n00b


Joined: 27 May 2015
Posts: 1

PostPosted: Wed May 27, 2015 10:54 am    Post subject: Reply with quote

Wow I had just the same trouble. Now it's ok
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP