atk4 / filestore

Implements integration between ATK UI and FlySystem
https://agiletoolkit.org/
MIT License
9 stars 8 forks source link

Fix token as 'type'=>'string' #13

Closed abbadon1334 closed 4 years ago

abbadon1334 commented 4 years ago

in recent PR was removed the type => string for File token. Using atk4/schema type => string with system => true is treated as integer, i think this is a bug in atk4/data

abbadon1334 commented 4 years ago

OR when schema request the type of the referenceOne linked field it gets null in place of string and fallback to integer?

DarkSide666 commented 4 years ago

Adding type=string should not change anything because type=string is by default in atk4/data. Probably that's something wrong in atk4/schema and not here or atk4/data.

abbadon1334 commented 4 years ago

yes, the problem is in schema : https://github.com/atk4/schema/blob/0a8e62c1f067a570f029eee4d48ee7284334cc22/src/Migration.php#L269

leaving the repo like this and used with schema will get type="integer" for token.

I think the better option is to merge this and discuss in atk4/schema what to do when type is not defined for referenceOne or leave it like this and advise that their_field of relations need to have a type, if not it will get integer as default even if field by default is string.

N.B. is not related to system=true

DarkSide666 commented 4 years ago

OK. Please create respective issue in atk4/schema.