Forum OpenACS Development: master tag wastes my day, bizzaro behavior

I've setup a few test pages which demonstrate the weird behavior of this tag. I'm not sure how much of this is intended, probably none of it.

These are on iunicycle.com:

  • /www/test/nosrc --> holds a master tag <master>
  • /www/test/src --> holds master tag <master src="@master@">
  • /www/test/nullsrc --> holds master tag <master src="">
  • /www/test.tcl --> some script which produces 'some text hi ho hi ho'
Another set, with the same files in in /www/notest/, check out:
  • /www/notest/src?master=

This returns an error.

Strange thing is that if the src="", that is okay, the default-master is eventually found as if just the master tag was there with no src attribute. However, if the @master@ variable is equal to the empty string, somehow, some way, the templating system chops off the last directory and looks for something below. In the test directory, this is great, because it finds test.tcl, but in the notest directory, an error is generated. Actually it isn't great, since it shouldn't be looking there, or looking for that file!

Bizzzarro two: the master tag is only executed once per thread. I put log statement in the master tag, and it only logs once for each url/thread combination.

Collapse
Posted by Tom Jackson on

Probably the source of the problem is the master tag uses the value of the src attribute, unsubstituted as a logic switch.

In this case it checks [emtpy_string_p $src], but $src = "@master@", not what master equals. :(.

Collapse
Posted by Lars Pind on
Tom, can you file a bug for this, please.
Collapse
Posted by Lars Pind on
Sorry, just continued reading the TIP thread.

There is an acs-templating parameter that causes templates to not be cached. I think you should use that for the case of a master template being added. I don't think we'll want to look for master templates in 5 different places on every request, if we can avoid it.

/Lars