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

do not set id to undefined #8232

Merged
merged 1 commit into from Oct 7, 2020
Merged

Conversation

alexandrebodin
Copy link
Member

@alexandrebodin alexandrebodin commented Oct 7, 2020

Signed-off-by: Alexandre Bodin bodin.alex@gmail.com

Description of what you did:

Fix #8227

Setting the attribute id to undefined will run an insert query with an undefined id binding.

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
@alexandrebodin alexandrebodin added this to the 3.2.2 milestone Oct 7, 2020
@alexandrebodin alexandrebodin added source: core:database Source is core/database package issue: bug Issue reporting a bug labels Oct 7, 2020
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

Tested on Heroku with the following commit: derrickmehaffy/Strapi-Heroku-Test@dbeccb0

(Also works locally)

Copy link
Member

@Convly Convly left a comment

Choose a reason for hiding this comment

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

LGTM, waiting for the tests

@codecov
Copy link

codecov bot commented Oct 7, 2020

Codecov Report

Merging #8232 into master will increase coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8232      +/-   ##
==========================================
+ Coverage   32.96%   33.03%   +0.07%     
==========================================
  Files        1197     1219      +22     
  Lines       13020    13563     +543     
  Branches     1286     1348      +62     
==========================================
+ Hits         4292     4481     +189     
- Misses       7885     8200     +315     
- Partials      843      882      +39     
Flag Coverage Δ
#front 24.71% <ø> (-0.35%) ⬇️
#unit 54.10% <ø> (+0.21%) ⬆️

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

Impacted Files Coverage Δ
...rapi-admin/admin/src/hooks/useFetchRole/reducer.js 80.00% <0.00%> (-20.00%) ⬇️
...min/admin/src/components/Roles/Permissions/init.js 80.00% <0.00%> (-20.00%) ⬇️
packages/strapi-admin/services/permission.js 77.57% <0.00%> (-14.00%) ⬇️
...in/src/containers/Users/ProtectedEditPage/index.js 87.50% <0.00%> (-12.50%) ⬇️
...t-type-builder/controllers/validation/relations.js 50.00% <0.00%> (-12.50%) ⬇️
.../admin/src/components/Roles/Permissions/reducer.js 85.41% <0.00%> (-12.15%) ⬇️
...ages/strapi/lib/services/entity-validator/index.js 54.11% <0.00%> (-9.78%) ⬇️
packages/strapi/lib/core-api/service.js 64.44% <0.00%> (-4.79%) ⬇️
.../admin/src/containers/Webhooks/EditView/reducer.js 82.35% <0.00%> (-4.32%) ⬇️
...admin/admin/src/containers/Roles/EditPage/index.js 55.17% <0.00%> (-4.09%) ⬇️
... and 106 more

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 e0287c8...b56b21a. Read the comment docs.

@alexandrebodin alexandrebodin merged commit e87af3f into master Oct 7, 2020
@alexandrebodin alexandrebodin deleted the fix/undefined-id-in-db-query branch October 7, 2020 21:11
@Stanko
Copy link
Contributor

Stanko commented Oct 8, 2020

Any estimate when this will be released?
Thanks for the hard work!

@derrickmehaffy
Copy link
Member

It will be in v3.2.2 but we are waiting on some other PRs to be merged to release.

@joshjung
Copy link
Contributor

joshjung commented Oct 8, 2020

Thanks for fixing this! Just ran into it myself and will wait for the 3.2.2 release soon :)

@joshjung
Copy link
Contributor

This is now confirmed fixed if you upgrade to 3.2.3.

@laportem
Copy link

I have just installed a fresh 3.2.4 and are having the same issue

@derrickmehaffy
Copy link
Member

I have just installed a fresh 3.2.4 and are having the same issue

Can you provide more information on your environment as I tested this fix on all 3 OS platforms:

  • Linux (Linux Mint 20 / Ubuntu 20.04)
  • Windows 10
  • MacOS

And with most of the databases:

  • SQLite
  • MariaDB
  • PostgreSQL
  • MongoDB

And couldn't reproduce the issue @laportem

@laportem
Copy link

my bad; I am on:
strapi 3.2.4
ubuntu 20.04
postgres 13

i am running strapi and postgres in docker on a vagrantbox runing ubuntu 20.04 (guest machine). This host machine is window 10 Pro

@derrickmehaffy
Copy link
Member

Are you able to share those vagrant files somewhere?

@laportem
Copy link

you can see the vagrantfile and docker-compose.yml here https://github.com/laportem/strapi_build

@derrickmehaffy
Copy link
Member

you can see the vagrantfile and docker-compose.yml here https://github.com/laportem/strapi_build

Also lets open up a new thread to discuss this issue, can you create a thread on our Forum so we aren't spamming a merged PR thread ;)

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.

database error after upgrade to v3.2.0 or v3.2.1
6 participants