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

Add missing 'format' reserved model word. #8194

Merged
merged 2 commits into from Oct 7, 2020
Merged

Add missing 'format' reserved model word. #8194

merged 2 commits into from Oct 7, 2020

Conversation

chachew
Copy link
Contributor

@chachew chachew commented Oct 5, 2020

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."

@chachew
Copy link
Contributor Author

chachew commented Oct 5, 2020

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'];
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RESERVED_ATTRIBUTE_NAME ??

@codecov
Copy link

codecov bot commented Oct 6, 2020

Codecov Report

Merging #8194 into master will decrease coverage by 0.01%.
The diff coverage is 14.28%.

Impacted file tree graph

@@            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              
Flag Coverage Δ
#front 25.05% <14.28%> (-0.01%) ⬇️
#unit 53.88% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...in-content-manager/admin/src/translations/index.js 0.00% <0.00%> (ø)
...ntent-type-builder/admin/src/translations/index.js 0.00% <0.00%> (ø)
...ugin-documentation/admin/src/translations/index.js 0.00% <0.00%> (ø)
...trapi-plugin-email/admin/src/translations/index.js 0.00% <0.00%> (ø)
...rapi-plugin-upload/admin/src/translations/index.js 0.00% <0.00%> (ø)
...-users-permissions/admin/src/translations/index.js 0.00% <0.00%> (ø)
...kages/strapi-admin/admin/src/translations/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 645c0b8...20dbc73. Read the comment docs.

Copy link
Member

@derrickmehaffy derrickmehaffy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug source: core:database Source is core/database package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants