Bugs item #602695, was opened at 2002-08-30 18:31
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=403611&aid=602695&group_id=31885
Category: Template
Group: current CVS
Status: Open
Resolution: None
Priority: 5
Submitted By: Richard Archer (richardarcher)
Assigned to: Richard Archer (richardarcher)
Summary: template::set_file unexpected behaviour
Initial Comment:
Reported via email by Joe Stewart:
If you call set_file twice with the same handle name
but different
filenames, the second file doesn't get loaded because
loadfile checks for
the existence of the varval and returns without loading
the file.
I was able to work around it by unsetting the varval
and varkey of the
handle before calling set_file. But it seems set_file
should do this if
$this->file[$varname] != $filename.
----------------------------------------------------------------------
Comment By: Joe Stewart (joestewart)
Date: 2002-08-30 19:22
Message:
Logged In: YES
user_id=77269
A little clarification:
Regarding - blindly overrwrite the filename?
That is not what I suggested. I only suggested that the
contents of the file requested to be used in the call to
set_file be used.
The call to set_file does change the file to be used
successfully now. It's just that loadfile checks for the
variable and if it exists does not grab the contents of the
new file and instead uses the current content ( old file).
The behavior of loadfile is otherwise a good thing and don't
suggest changing it.
thanks,
Joe
----------------------------------------------------------------------
Comment By: Richard Archer (richardarcher)
Date: 2002-08-30 18:35
Message:
Logged In: YES
user_id=279311
I imagine that in typical use set_file would only be called
once per varname, and anything else would be unintended.
Nevertheless, I can see that if you *do* want to override a
previous file, the current system makes this inordinately
difficult.
How should this change?
- leave as is with better documentation?
- blindly overrwrite the filename?
- throw an error if the same handle is set_file'd twice?
- ...
...R.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=403611&aid=602695&group_id=31885
|