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!

CommentFileSizeAuthor
#5 mvf_926492.patch913 bytescrea

Comments

chris_car’s picture

After 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

crea’s picture

Title: Values not stored in database table » hook_content_is_empty() uses wrong checks
Priority: Normal » Critical

Looks like there's a problem with hook_content_is_empty(). It's amazing that this is discovered so late.

crea’s picture

Title: hook_content_is_empty() uses wrong checks » Values not stored in database table

Hmm 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 ?

crea’s picture

I'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.

crea’s picture

Title: Values not stored in database table » Bad handling of zero values
StatusFileSize
new913 bytes

Please try this patch.

chris_car’s picture

Status: Active » Fixed

The patch worked. Thank you for your fast reply!

Chris

crea’s picture

Status: Fixed » Needs review

This will be fixed once its committed.

crea’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.