Bug #20994

db_list doesn't show '0' values

Added by David Bruchmann over 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2009-09-04
Due date:
% Done:

0%

TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Values '0' aren't shown in db_list, neither if given by Sring nor by Int.

Furthermore Single-View saves '0' as Int but all fields are shown with value '0' even if there is no entry in database.

TypeHandling has to be included because some tables need explicit '0'-Values and controlling the entries is impossible with current behavior.

(issue imported from #M11875)

db_list_faults.jpg View (460 KB) Administrator Admin, 2009-09-07 22:46

11875_db_list_doesnt_show_0_values.patch View (875 Bytes) Administrator Admin, 2009-09-08 13:56

fault_editform.jpg View (175 KB) Administrator Admin, 2009-09-09 14:35


Related issues

Related to TYPO3 Core - Bug #21007: 'exclusiveKeys' => '0' in 'select' type field in TCA does't work as intended Closed 2009-09-07

History

#1 Updated by Rupert Germann over 10 years ago

I don't get the point yet - could you explain this further? steps to reproduce.....

#2 Updated by David Bruchmann over 10 years ago

Hy Rupert,

when you have saved a Value '0' in the Database db_list doesn't show it.
You can work with that '0' in extensions or you can show it in Frontend but
you can't control it by db_list in Backend.

In Listview db_list shows nothing and in singleview all empty integerfields show '0' too, so it's impossible to distinguish the saved one from the others.

I remarked that by building a static table where '0' is just a value for an option (http://en.wikipedia.org/wiki/ISO_5218). And having '0' is not the same as nothing.

Best Regards
David

#3 Updated by Rupert Germann over 10 years ago

ok, now i got: if you save a content element with title (header) = 0 (the number zero)
the list module will show [no title], the page module will simply show nothing

but what is the metioned "singleview"? do you talk about the editform?

#4 Updated by David Bruchmann over 10 years ago

Yes, I meant the editform.
Sorry, could have called it 'editform' ;-)

#5 Updated by Oliver Hader over 10 years ago

David, could you please attach a screenshot? Thus everyone can be sure, that we talk about the same... Thanks! ;)

#6 Updated by David Bruchmann over 10 years ago

Sure,

have a look at db_list_faults.jpg above.

Best Regards
David

#7 Updated by David Bruchmann over 10 years ago

Hy Bastian,

The Patch helped for db_list but not for the editform with eval=int in TCA

I have installed it on version 4.2.8 some where some lines of the class look a bit different as in your patch but I don't think that this makes a difference.

I added another Screenshot to explain the problem.

Best Regards
David

#8 Updated by David Bruchmann over 10 years ago

Hy Bastian,
Regrettable I remarked that the file lang/locallang_common.xml doesn't exist in V4.2.8 is it perhaps for 4.3 only?
Best Regards
David

I took the file from 4.3 that fixed another Bug with missing Icons in Dropdownboxes too - FINE!

#9 Updated by David Bruchmann about 10 years ago

The Patch works and fixes the required changes - +1 by Testing.

The mentioned misbehavior in editform is a configuration-item in TCA and can be fixed by setting click=>'' instead of click=>'0' upon 'config'.
Example:

TCA['TABLENAME'] = Array(
'columns' => array(
'FIELDNAME' => array(
'config' => array (
'type' => 'input',
'size' => '2',
'max' => '1',
'eval' => 'int',
'checkbox' => '', ##### << Here it is, the solution
'range' => array (
'upper' => '9',
'lower' => '0'
),
'default' => 0
),
....

#10 Updated by Rupert Germann about 10 years ago

committed to trunk rev 5996

Also available in: Atom PDF