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

undefined index : insert_tags in Smarty.class.php line 1243

 
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
rdalverny
Smarty Rookie


Joined: 03 Oct 2003
Posts: 8

PostPosted: Fri Oct 10, 2003 10:44 am    Post subject: undefined index : insert_tags in Smarty.class.php line 1243 Reply with quote

Hey there,

when running a page using Smarty to be rendered, I always get this notice :

Code:
Undefined index: insert_tags in Smarty.class.php line 1243


The code I use is pretty common :
Code:
$s = new Smarty();
  $s->use_sub_dirs = false;
  $s->template_dir  = 'templates';
  $s->compile_dir   = 'templates_c';
  $s->cache_dir     = 'cache';

  $s->caching = true;
  $s->cache_lifetime = 172800;
  $s->compile_check = true;
  if( !$s->is_cached('template.html', $myId) // $myId being set before
  {
     $stuff = get_stuff( $myId );
     $s->assign('stuff', $stuff);
  }
  $s->display('template.html', $myId);


Does someone know if this has any particular consequence ? And how it could be fixed (I guess it's a Smarty bug actually) ?
It occurs with both 2.6.0 RC.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Oct 10, 2003 11:16 am    Post subject: Reply with quote

hmm, line 1243 in RC2 reads:
if (@count($this->_cache_info['insert_tags']) == 0

q1: how the hell do you make notices displayed of functions that are forced silent with the @-operator ???

q2: how do you make notices in the display-queue displayed with debugging turned off? (you didn't mention in your posting or your source-code that debugging is enabled)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rdalverny
Smarty Rookie


Joined: 03 Oct 2003
Posts: 8

PostPosted: Fri Oct 10, 2003 11:44 am    Post subject: Reply with quote

answer : I'm not sure ; I defined my own error handler, and set it up with set_error_handler() (see http://fr2.php.net/manual/en/function.set-error-handler.php ). error_reporting has no effect, nor does @ operator.

Just a common practice for me to see if any problem may appear in my scripts. Useful for debugging before bug appears. Smile

But, ok, in this case, I'll be silent for this one, it's not _that_ worrying ; I don't know if it _should_ be set (that's the question), but if not, this will make it look right :

Code:
if( isset( $this->_cache_info['insert_tags'] )
    AND
    count( $this->_cache_info['insert_tags'] ) == 0 ) )
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Oct 10, 2003 12:05 pm    Post subject: Reply with quote

i'd stick to @count() here (performance over correctness in this particular case).

in your error-handler you should check "if (error_reporting()==0) ..."
this indicates the error was raised in a context that was silenced via @.
Back to top
View user's profile Send private message Send e-mail 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 -> 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