Are 0 values in numeric subfields considered NULL?

Created on 12 July 2025, 21 days ago

Problem/Motivation

I'm implementing a Tamper:Math function with the ECA module on two custom field subfieds of type numeric (decimal) . If any of the two fields has 0.00 value, I receive an error from the tamper math module. If i change the value to whatever else (e.g. 0.01), the process is executed correctly.

While I am not sure, I thought the error could be similar to the one mentioned here 🐛 Issue with feeds importing `0` value as `NULL` Active , according to which in feed imports the 0 values are treated as empty.

Steps to reproduce

1. Create a custom field with 2 numeric subfieds.
2. Create a simple ECA model using the Tamper:Math function, supposed to add / substract the values in the two numeric subfieds.
3. If any of the two values is 0, or 0.00, you receive an error by the Tamper module.
4. Change any of the values to whatever other value, the error is gone.

Also if you try to display the subfield value via token in ECA, a 0 value subfield is listed as an empty token.

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

🇮🇪Ireland marksmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @marksmith
  • 🇺🇸United States apmsooner

    The issue you linked is completely unrelated as it was a feeds plugin issue with the other one. You're getting the correct value out of the db (0.00) so I would assume this issue is with the tamper module. Without knowing what the error is, I can't really help point you to the problem. You can probably debug what data is somewhere in here: https://git.drupalcode.org/project/tamper/-/blob/8.x-1.x/src/Plugin/Tamp... but ultimately you should identify what error is being thrown.

  • 🇮🇪Ireland marksmith

    Thanks for the quick response.

    On a closer look, I think the empty token problem is not related to the Tamper module. Rather the Tamper error is probably thrown due to a missing / empty value that is expected to be delivered by the custom_field subfield token.

    I have created a short video showing the problem, which may illustrate what I am talking about. I show here that the subfied token value is empty if the subfield value is set to 0.

  • 🇺🇸United States apmsooner

    Odd cause I'm not seeing this issue when you use the same tokens in the manage display type 'Custom template'. If you have token module installed and browse the custom_field tokens for the decimal value, you should see it render 0.00 as it should. In ECA though maybe its doing something different with the tokens? Could you try appending ':value' to the token(s) you're using?

    E.g. [numeric_field:number_1:value]

  • 🇺🇸United States apmsooner

    If the above doesn't work, maybe you can split the Get custom field value into 2 separate parts and target the property directly vs. just the field.
    Example: field_custom_numeric_field.number_1 as token number_1 AND field_custom_numeric_field.number_2 as token number_2. It seems like #5 though should be working though. You might ask jurgenhaas in the ECA slack channel otherwise if he has any clues.

  • 🇺🇸United States apmsooner

    Closing this as it was resolved via alternate token settings in ECA.

Production build 0.71.5 2024