FIX Parse negative numbers in class spec#11908
FIX Parse negative numbers in class spec#11908beerbohmdo wants to merge 1 commit intosilverstripe:5.4from
Conversation
163a328 to
68a3a2d
Compare
|
Hi there, This seems like it's probably a fine solution (though I haven't tested it yet) - since this is a bug with CMS 5.4, can you please retarget this PR to the You'll probably also need to reset your commits after changing the target branch. |
5fa8ac8 to
e410f68
Compare
GuySartorelli
left a comment
There was a problem hiding this comment.
This solution is fine for the standard case, but breaks down in an edge case where a class name (which can also be an injector name so usual class name rules may not apply) includes a hyphen.
For example if I add this YAML config:
SilverStripe\Core\Injector\Injector:
Int-new:
class: SilverStripe\ORM\FieldType\DBIntand then I create this data object:
class MyDataObject extends DataObject
{
private static $db = [
'MyTest' => 'Int-new(15)',
];
}The default for that int field is -15 but it should be 15.
Before negative numbers was interpreted as possitive numbers.
e410f68 to
b0a2a40
Compare
|
I changed my method for checking for the minus, this should be more relyable. BUT I don't think your edge case is realy one. Because: Your example currently does not work also. It parses to: Btw. if you swap the So we need a better way to handle the class/identifier part. But I am not sure if this is part of this issue. Give me the ok and I will look into that. |
Before negative numbers was interpreted as possitive numbers.
Description
Manual testing steps
Issues
Pull request checklist