Bug #20994
closed
db_list doesn't show '0' values
Added by David Bruchmann about 15 years ago.
Updated over 14 years ago.
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)
Files
I don't get the point yet - could you explain this further? steps to reproduce.....
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
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?
Yes, I meant the editform.
Sorry, could have called it 'editform' ;-)
David, could you please attach a screenshot? Thus everyone can be sure, that we talk about the same... Thanks! ;)
Sure,
have a look at db_list_faults.jpg above.
Best Regards
David
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
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!
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
),
....
committed to trunk rev 5996
Also available in: Atom
PDF