I configured the measured field module to allow me enter a range (from - to) of values. I have written a small module in order to get my own units:
function wine_style_units_define_units() {
$items = array();
$items['sweetness'] = array(
'category_id' => 'sweetness',
'category' => t('Sweetness'),
'shortname' => 'g/l',
'fullname' => 'Sweetness',
'symbol' => 'g/l',
'decimals' => 0,
);
This shows me correctly my unit selector. But after inserting values in the node edit form, no values get inserted into the database table (just the vid and nid though).
Any help would be very much appreciated!
Thank you!
Comments
Comment #1
chris_car commentedAfter some more testing I found that I was not correct with my previous bug report. The problem is the FROM field in a range configuration. If I enter 0 as value, it is just not stored in the database (and the TO value neither), although there is no min or max value defined (even if there is a min max value defined, it is not stored either, if a 0 is entered).
Any help would be very appreciated.
Chris
Comment #2
crea commentedLooks like there's a problem with hook_content_is_empty(). It's amazing that this is discovered so late.
Comment #3
crea commentedHmm I can't reproduce this. Though I can see it could be a problem with hook_content_is_empty() because empty() check is used which could treat zero values as empty rows.
Can you post instructions to reproduce the problem or give access to your test site ?
Comment #4
crea commentedI've reproduced it with decimals set to 0. Looks like decimal formatting prevents triggering of the bug because the values become strings with a dot.
Comment #5
crea commentedPlease try this patch.
Comment #6
chris_car commentedThe patch worked. Thank you for your fast reply!
Chris
Comment #7
crea commentedThis will be fixed once its committed.
Comment #8
crea commentedCommitted.