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

2.6RC1 causes plugins to fail

 
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
Budda
Smarty Regular


Joined: 19 Apr 2003
Posts: 53
Location: Lymm, Cheshire. UK

PostPosted: Wed Aug 13, 2003 12:52 pm    Post subject: 2.6RC1 causes plugins to fail Reply with quote

Hi,

Just installed RC1 of Smarty but its causing one of the plugins i use to fail.

The error message is:
Code:
Fatal error: Call to a member function on a non-object in c:\php4\pear\Smarty\plugins\modifier.date.php on line 14


Its not a plugin distributed with the core archive of Smarty so it hasn't been tweaked. I'd like ot know what is needed to fix it though.

modifier.date.php...
[php:1:35c152fbbb]<?php
require_once $this->_get_plugin_filepath('shared','make_timestamp');
function smarty_modifier_date($string, $format="%b %e, %Y", $default_date=null)
{
if($string != '') {
return date($format, smarty_make_timestamp($string));
} elseif (isset($default_date) && $default_date != '') {
return date($format, smarty_make_timestamp($default_date));
} else {
return;
}
}
?>[/php:1:35c152fbbb]

Hope somebody can explain what happened to $this in the first line then (this is what line 14 is) Smile
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
andre
Smarty Pro


Joined: 23 Apr 2003
Posts: 164
Location: Karlsruhe, Germany

PostPosted: Wed Aug 13, 2003 1:40 pm    Post subject: Reply with quote

Try to replace the second line
Code:
require_once $this->_get_plugin_filepath('shared','make_timestamp');
with
Code:
require_once $smarty->_get_plugin_filepath('shared','make_timestamp');


I think they renamed $this to $smarty ... if I remember correctly.
Back to top
View user's profile Send private message
Budda
Smarty Regular


Joined: 19 Apr 2003
Posts: 53
Location: Lymm, Cheshire. UK

PostPosted: Wed Aug 13, 2003 5:13 pm    Post subject: Reply with quote

Seems to have worked a treat. Cheers! Cool
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
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