|
Main sidebar
|
PITS /
01152Summary: Display empty and undefined variables as null
Created: 2009-11-14 13:43
Status: Closed - added for 2.2.14
Category: Bug
From: simon
Assigned:
Priority: 544
Version: 2.2.7
OS: any
Description: When variables from include directives and pagelist directives are used in a wiki page, but are undefined, or incorrectly defined (see test page) they should display consistently as do page variables and page text variables. These include and pagelist variables should display as null where not defined or defined as empty ("Avar="). See See also This is not a bug, it is specifically designed to be this way. These {$$variables} are designed to be replaced by a value when it is found, and to stay as is, if there is no value defined. They can be used in huge templates, where the authors may not remember all template parameters -- looking at the output, they'll immediately know what was forgotten; if the values are empty, they'll have to go to the template page, view the source and search what was missing. PmWiki gives you other ways to display nothing if a variable isn't defined: PageTextVariables. In your included template, you can use DaveG: The 'problem' is in comparisons, and trying to determine if the variables are empty. Doing empty comparisons produce results authors would not expect: Simon: There is also an issue of consistency, and the principle of "least surprise". I do not consider that different types of variables should display in different ways. To me inconsistency leads to "surprise".
|