Bug #14935
closedTypo3 can't display a single "0" in a table cell
0%
Description
In a text element containing a table a single "0" in a cell isn't rendered properly in the FE outbut but a "1" (for example) does:
<td>0<td> becomes to <td> </td> but
<td>0 </td> stays <td>0 </td> and
<td>1</td> stays <td>1</td>
I've tested various setups with Typo 3.7.1 and 3.8. with different RTEs. Even putting the HTML-table code in tt_content didn't produce the right output.
(issue imported from #M1391)
Files
Updated by Michael Stucki over 19 years ago
I can confirm this. The attached patch fixes the problem.
Updated by Markus Walter over 19 years ago
Thanks for the fast patch, but applying this patch makes the headings of content-elements rendered any more.
Updated by Michael Stucki about 19 years ago
Are you sure this is a bug? Where does that happen? Can you send me the TS code that generates the headings?
Updated by Markus Walter about 19 years ago
I've tested the patch in two environements; always the same result: without the patch no "0" in the tables, with patch "0" but no headings of the content elements.
In the first setup I'm using css_styled_content with the default headings (so i didn't changed the TS) (Typo 3.8)
The second setup is the Testsite-Package (3.8). Perhaps you can reproduce it with this installation.
Updated by Michael Stucki about 19 years ago
I can reproduce this behavior and found the problem of it:
In content (default) and probably some other templates, the title is rendered depending on the value of the field "header_layout":
key {
field = header_layout
ifEmpty = 1
ifEmpty.override.data = register: defaultHeaderType
}
This means that if header_layout is not selected (empty), then the value is set to 1 or even (if it is set) to the value of "register: defaultHeaderType". Sounds more complicated than it actually is.
However, the problem is simple: If header_layout is not set, then the value is not "" but "0". This is a big difference and probably a wrong design of that template.
The best solution would in my opinion be to add a new property "ifNull" which fits better for selecting default keys. However this could affect many existing templates which are currently depending on that behavior.
TSref writes on ifEmpty:
if the content is empty (trimmed) at this point, the content is loaded with
"ifEmpty".
=> Zero's are an empty value. <=
Updated by Sebastian Widmann about 19 years ago
The patch is not working with TV, content-headers will not be shown?! The problem occurs after I changed the file. An undo shows the headers again.
Can somebody reproduce this?
Updated by Michael Stucki about 19 years ago
Did you read my last post? I'm quite sure it's the same problem, and it does not only affect the header_layout field but also many other cases where ifEmpty is used.