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
Add missing 'format' reserved model word. #8194
Conversation
Per conversation with Derrick, https://forum.strapi.io/t/simple-one-to-one-relation-throws-error/218, i created this PR |
@@ -1,7 +1,7 @@ | |||
'use strict'; | |||
|
|||
// contentTypes and components reserved names | |||
const RESERVED_MODEL_NAMES = ['admin', 'boolean', 'date', 'date-time', 'time', 'upload']; | |||
const RESERVED_MODEL_NAMES = ['admin', 'boolean', 'date', 'date-time', 'format', 'time', 'upload']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll be a field name, not the model name. I've tested with model names and it's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RESERVED_ATTRIBUTE_NAME ??
Codecov Report
@@ Coverage Diff @@
## master #8194 +/- ##
==========================================
- Coverage 32.96% 32.95% -0.02%
==========================================
Files 1197 1197
Lines 13020 13027 +7
Branches 1286 1286
==========================================
+ Hits 4292 4293 +1
- Misses 7885 7891 +6
Partials 843 843
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description of what you did:
Fixed issue where user was allowed to create a model with reserved word 'format'. Creating this model would then break one-to-one relationships and cause an error: "Maximum call stack size exceeded."