[Chameleon-dev] [Bug 1375] [Chameleon-Service Instance]Error shows up when the service instance is accessed

bugzilla-daemon at bugzilla.maptools.org bugzilla-daemon at bugzilla.maptools.org
Thu Mar 23 14:13:22 EST 2006


http://bugzilla.maptools.org/show_bug.cgi?id=1375

nsavard at mapgears.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED



------- Additional Comments From nsavard at mapgears.com  2006-03-23 14:13 -------


There was a configuration problem when I tried to access the service instance
with this URL:
http://path/to/chameleon/cwc2/cwc2.php?service=VCG&version=0.1.0&
request=GetApplication

The default_template path, default_context path, context_root path and
template_root were wrong.  I correct that and it works with this URL.

But when I tried to use a more complex URL by specifying two languages and two
templates URLs, I got this error:

PHP Warning:  md5_file(): Unable to open file in
/opt/fgs-mshead/apps/chameleon-cvs_HEAD/htdocs/chameleon.php on line 477

The problem is caused by a for loop index modified by an inner for loop in the
templates handling section in cwc2.php.  The same index "$i" is used for both
loops.  To fix that I change the inner for loop index to "$j".

More details on what the problems is.  Templates pointed out by URLs are
supposed to be replaced by cached files with the "$aszTemplates[$i] =
$szCachedTemplate;" line of code (see code below).  The $i index starts at zero,
after the inner for loop, the index jumps to 268 (see dump).  So
$aszTemplates[0] and $aszTemplates[1] are never overwritten with cached file
name.  It is why md5_file() function in chameleon.php complains that it cannot
find the file.

-------------------
Dump of $aszTemplate:

array(3) {
  [0]=>
  string(66) "http://127.0.0.1:8080/chameleon/cwc2/templates/sample_cwc2_en.html"
  [1]=>
  string(66) "http://127.0.0.1:8080/chameleon/cwc2/templates/sample_cwc2_fr.html"
  [268]=>
  string(48) "/tmp/sess_4422e9f7663a7/4422e9f76a1deqh37Mf.html"
}


----------------

for($i=0; $i<$nTemplates; $i++)
{
    code

    ...

    for($i=0; $i<$nbLine; $i++)
    {
        fwrite($fh, $aszTemplate[$i]);
    }
    fclose($fh);

    $aszTemplates[$i] = $szCachedTemplate;

        ...      

}



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Please do NOT reply to this email, use the link above instead to 
login to bugzilla and submit your comment. Any email reply to this
address will be lost.


More information about the Chameleon-dev mailing list