rejetto forum

Software => HFS ~ HTTP File Server => Bug reports => Topic started by: Mars on March 24, 2011, 08:57:01 PM

Title: How putting in check of hfs
Post by: Mars on March 24, 2011, 08:57:01 PM
Quote from: Used reference text
procedure keepTplUpdated();
begin
if fileExists(tplFilename) then
  if newMtime(tplFilename, tplLast) then
    setTplText(loadFile(tplFilename))
  else
else
  if tplLast <> 0 then
    begin
    tplLast:=0; // we have no modified-time in this case, but this will stop the refresh
    setTplText(defaultTpl);
    end;
end; // keepTplUpdated

1) Execute hfs with a personalized template

2) Verify the web page by means of the browser

3) Rename the template filename without closing hfs

4) Refresh the web page of the browser, the default template is used on the place of the other one

5) close hfs with saving options

6) Relaunch hfs and refresh the web page

The shown page is of one such whiteness  :D ;D

if you restore the personalized template, everything becomes again normal

Conclusion: To resolve this loss of external template it is enough to settle by adding a line

Quote from: main.pas
......
    if h = 'tpl-file' then tplFilename:=l;
    if h = 'tpl-editor' then tplEditor:=l;
      if h = 'graph-visible' then
      if yes then showGraph()
      else hideGraph();
    // extra commands for external use
     if h = 'load-tpl-from' then setNewTplFile(l);  //WARNING TO REJETTO This line is not any more used
  except end;
  end;

if not fileExists(tplFilename) then tplfilename:='' end;

if not alreadyStarted then
  // i was already seeing all the stuff, so please don't hide it
  if (build > '') and (build < '006') then easyMode:=FALSE;



******************
other bug with his solution

 if you replace the external template by one with the same name, the modification is not taken into account in hfs because of the following line in classeslib.pas:

result:=o.tpl;
if getMtime(fn) <= o.ts then exit;  //remove the < char
o.ts:=getMtime(fn);

Title: Re: How putting in check of hfs
Post by: rejetto on March 25, 2011, 10:56:27 AM
Conclusion: To resolve this loss of external template it is enough to settle by adding a line

thank you


Quote
if you replace the external template by one with the same name, the modification is not taken into account in hfs because of the following line in classeslib.pas:

ok, it's an acceptable case, i apply.