verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
96 stars 72 forks source link

Calculation input value not showing correctly in notification #2152

Open thomascoppein opened 1 week ago

thomascoppein commented 1 week ago

Describe the bug

I'm using a Calculations input to get a price value: number input value * 10. When trying to print this value in a notification I get an null, while in the submissions that value is correctly. Is there a way to print this value in the notifications?

Steps to reproduce

  1. Add a form
  2. Create Calculations input
  3. Make formula: Number input * 10 (for example)
  4. Create notification and print Calculations value in notification.

Form settings

Craft CMS version

4.13.0

Plugin version

2.1.33

Multi-site?

No

engram-design commented 1 week ago

So that seems to be working for me, both when referencing just the Calculations field, and using the All Fields token.

Any errors in your /storage/logs/formie.log files?

thomascoppein commented 1 week ago

There are no errors in the formie.log files.

However, I’ve identified the issue. I intended the calculation to happen automatically, so I set the field to be disabled. When I removed this setting, the Calculations field displayed correctly. Is this behavior intentional?

Also thanks for the quick response 🚀

engram-design commented 1 week ago

Ah, I see! Changing that to hidden should work, I'll look into what we can do about disabled fields, but that might be a tad complex.

thomascoppein commented 1 week ago

I noticed that the readonly attribute is set by default on this input field, so the disabled attribute isn’t really necessary. I can’t use the hidden attribute either, as I want the calculated value to be visible on the frontend.