Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. Value at field_collection_item()->field_farm_quantity_value->denominator: 1.000000000000000000000000. in EntityMetadataWrapper->set() #367

Closed
mstenta opened this issue Nov 10, 2020 · 2 comments
Labels

Comments

@mstenta
Copy link
Member

mstenta commented Nov 10, 2020

The change in 7aa49b6 has started causing issues elsewhere. Notably, many quick forms will create quantity measurement logs, which call fraction_from_decimal(), which uses BCMath to create a numerator and denominator. These quick forms (like the Eggs form) were resulting in the following error:

EntityMetadataWrapperException: Invalid data value given. Be sure it matches the required data type and format. Value at field_collection_item()->field_farm_quantity_value->denominator: 1.000000000000000000000000. in EntityMetadataWrapper->set() (line 122 of /var/www/html/profiles/farm/modules/contrib/entity/includes/entity.wrapper.inc).

@paul121 and I did a ton of testing and discovered an interesting bug with PHP that causes the bcscale to persist across page loads within an Apache process: https://bugs.php.net/bug.php?id=78330

This bug is fixed in PHP 8: php/php-src@ac87880

However, the change in 7aa49b6 is what actually caused the issue to become apparent.

@mstenta mstenta added the bug label Nov 10, 2020
mstenta added a commit that referenced this issue Nov 10, 2020
@mstenta
Copy link
Member Author

mstenta commented Nov 10, 2020

I have reverted 7aa49b6, and now we'll dig into it a bit deeper to understand what is going wrong...

d6ed1f0

@mstenta
Copy link
Member Author

mstenta commented Nov 10, 2020

The original PR explains the issue that was being fixed: #365

I opened a new issue (can't reopen the PR) to follow-up on what that PR was originally trying to solve: #368

Closing this.

@mstenta mstenta closed this as completed Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant