- Issue created by @jbuttler
- 🇩🇪Germany jurgenhaas Gottmadingen
Can you explore a bit on versions you're using? Especially Drupal core and PHP.
The issue comes from
\Drupal\Core\Field\Plugin\Field\FieldType\DecimalItem::preSave
where Drupal core calls this:$this->value = round($this->value, $this->getSetting('scale'));
But I haven't found anything that core makes sure, that
$this->value
is either integer or a float. I guess that the setter of that value should ensure that. Not sure if other modules that leverage those field's APIs should be responsible for that. No problem, and thanks for the help!
I am using
- Drupal 10.4.0
- ECA 2.1.0
- Php 8.3.11All modules are currently up to date
- 🇩🇪Germany jurgenhaas Gottmadingen
I've raised the question about type casting in Drupal core for that field type on Slack: https://drupal.slack.com/archives/C1BMUQ9U6/p1735560859456079
Let's see if we get any idea there on how and where this should be handled.
- 🇩🇪Germany jurgenhaas Gottmadingen
So, there's an MR in 🐛 FieldType DecimalItem may fail with a TypeError in preSave Active now which you can use to patch Drupal core, so that this problem would be gone. Would you please give that a try and let us know if that resolves it for you?
Automatically closed - issue fixed for 2 weeks with no activity.