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

Fatal error: UnCaught exception

 
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 -> Installation and Setup
View previous topic :: View next topic  
Author Message
kahliala
Smarty n00b


Joined: 12 Oct 2011
Posts: 3

PostPosted: Wed Oct 12, 2011 10:49 am    Post subject: Fatal error: UnCaught exception Reply with quote

I'm totally new to using Smarty and puzzled to say the least.
I'm getting the following error using Smarty with OPUS offering from Ulster University:-

[Wed Oct 12 11:44:54 2011] [error] [client 10.15.4.8] PHP Fatal error: Uncaught exception 'SmartyException' with message 'Call of unknown function 'Smarty'.' in /usr/local/smarty/libs/sysplugins/smarty_internal_templatebase.php:695\nStack trace:\n
#0 /usr/local/uuwaf/include/WA.class.php(81):Smarty_Internal_TemplateBase->__call('Smarty', Array)\n#1 /usr/local/uuwaf/include/WA.class.php(81): WA->Smarty()\n
#2 /usr/local/uuwaf/include/UUWAF.class.php(37): WA->__construct(Array)\n
#3 /usr/local/apache2/htdocs/index.php(4Cool:UUWAF::get_instance(Array)\n
#4 /usr/local/apache2/htdocs/index.php(17): main()\n
#5 {main}\n thrown in /usr/local/smarty/libs/sysplugins/smarty_internal_templatebase.php on line 695

Cannot decipher what is going on here any help greatly appreciated.
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Wed Oct 12, 2011 11:18 am    Post subject: Reply with quote

/usr/local/uuwaf/include/WA.class.php line 81 is calling the method Smarty() - which does not exist. I guess this is a Smarty 2.6 upgrade error. In PHP5 constructors are called __construct(), and not like PHP4 used to call them by the class name.
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
kahliala
Smarty n00b


Joined: 12 Oct 2011
Posts: 3

PostPosted: Wed Oct 12, 2011 12:21 pm    Post subject: Reply with quote

globe wrote:
/usr/local/uuwaf/include/WA.class.php line 81 is calling the method Smarty() - which does not exist. I guess this is a Smarty 2.6 upgrade error. In PHP5 constructors are called __construct(), and not like PHP4 used to call them by the class name.


If what you say is true can you point me in the right direction to be able to sort this.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Oct 12, 2011 2:03 pm    Post subject: Reply with quote

Use constructors like this:

http://php.net/manual/en/language.oop5.decon.php

ie. do not use the class name as the constructor.
Back to top
View user's profile Send private message Visit poster's website
kahliala
Smarty n00b


Joined: 12 Oct 2011
Posts: 3

PostPosted: Mon Oct 24, 2011 11:25 am    Post subject: Reply with quote

mohrt wrote:
Use constructors like this:

http://php.net/manual/en/language.oop5.decon.php

ie. do not use the class name as the constructor.


Tried the above and unfortunately I'm completely new to PHP This is the code that is creating the error any help in changeing or sorting this would be of great assistance :-

function __construct($config)
{
$this->Smarty();

There is much more but this is line 81 with Smarty


Mike
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Oct 24, 2011 12:37 pm    Post subject: Reply with quote

Code:
function __construct() {
   parent::__construct();
}


get rid of the call to $this->Smarty()
Back to top
View user's profile Send private message Visit poster's website
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 -> Installation and Setup 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