[TYPO3-dev] constants not replaced if file not found

Franz Holzinger franz at fholzinger.com
Tue Feb 26 10:15:48 CET 2008


Hello,

if you set the filename under constants
plugin.tt_products {
    # cat=plugin.products/file; type=file[html,htm,tmpl,txt]; label=
Template File: This is a simple textfile where each part of the shopping
basket is defined with HTML-code. To see an example with explanations,
take a look at EXT:tt_products/pi1/products_template.tmpl which is the
default.
  file.templateFile = not_exinsting_file.tmpl

And the setup has by default:

plugin.tt_products {
  templateFile = {$plugin.tt_products.file.templateFile}


Then the extension will not get the wrongly set filename, but the text
{$plugin.tt_products.file.templateFile}.
This is not very usefull, because the error message cannot tell you
about the filename you have set. Or which is the reason for not
substituting the templateFile if the file is not found or in other cases
 (type string), if the string is unset?


constants:
    # cat=plugin.products//; type=boolean; label=always in Stock: The
stock will never get reduced.
  alwaysInStock = 1


setup:
alwaysInStock  = {$plugin.tt_products.alwaysInStock}


If someone does not have alwaysInStock in the constants, then the setup
will not be replaced by an empty string.
So this code will be necessary to handle the cases correctly,

if ($this->conf['alwaysInStock'] == '{$plugin.tt_products.alwaysInStock}')	{
	$this->conf['alwaysInStock'] = '';
}
if ($this->conf['AlwaysInStock'] == '{$plugin.tt_products.AlwaysInStock}')	{
	$this->conf['AlwaysInStock'] = '';
}


So I propose to change the behaviour of TYPO3 to let the filename into
the setup to have a error output in the extension.
Or how can I read the constants directly from inside of the extension?
It would be even better not to have to assign all those constants to
equivalent setup names as shown above.

What do you prefer?

Greetings,

Franz







More information about the TYPO3-dev mailing list