You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#49504 breaks saving of string columns in certain cases.
As shown in the reproduction steps, sometimes string fields contain numbers that should not be parsed as decimals. I'd like to suggest to revert the pull request. I guess the dirty state issue in that pr could be solved using casts or mutators.
Steps To Reproduce
To trigger the bug store an integer in a string field of a model and use an invalid integer on the next save. E.g.
$address = newAddress(['building' => '107']); // building is a varchar(255)$address->save();
$address->building = '5 '; // note the whitespace $address->save();
will result in:
1) Tests\Import\Stories\AddressTest::testStrangeBuilding
Brick\Math\Exception\NumberFormatException: The given value "5 " does not represent a valid number.
/home/ape/s/ws/wasser_web/vendor/brick/math/src/BigNumber.php:69
/home/ape/s/ws/wasser_web/vendor/brick/math/src/BigNumber.php:76
/home/ape/s/ws/wasser_web/vendor/brick/math/src/BigDecimal.php:56
/home/ape/s/ws/wasser_web/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php:2104
The text was updated successfully, but these errors were encountered:
Laravel Version
10.40.0
PHP Version
8.2
Database Driver & Version
No response
Description
#49504 breaks saving of string columns in certain cases.
As shown in the reproduction steps, sometimes string fields contain numbers that should not be parsed as decimals. I'd like to suggest to revert the pull request. I guess the dirty state issue in that pr could be solved using casts or mutators.
Steps To Reproduce
To trigger the bug store an integer in a string field of a model and use an invalid integer on the next save. E.g.
will result in:
The text was updated successfully, but these errors were encountered: