From f661b9699a919a197add965112c7c9a4356c284b Mon Sep 17 00:00:00 2001 From: Dustin Date: Mon, 14 May 2018 13:39:04 +0200 Subject: [PATCH 1/3] (doc) add npm install as last step For me, copying the files from the newly generated strapi environment was not sufficient. When I started the strapi after following the guide, I got the following error: ``` /home/xxx/Dev/Projects/xxx/server/node_modules/mongodb/lib/mongo_client.js:804 throw err; ^ TypeError: Cannot read property 'globalId' of undefined ``` I guess this was the case because strapi-mongoose was not upgraded. I don't know if I'm blind or did not read the migration guide carefully enough, but for me a `npm install` at the end did the trick and upgraded it. Maybe this is helpful for you --- .../3.x.x/en/migration/migration-guide-alpha-10-to-alpha-11.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/3.x.x/en/migration/migration-guide-alpha-10-to-alpha-11.md b/docs/3.x.x/en/migration/migration-guide-alpha-10-to-alpha-11.md index 1bf3f78617..0c16474b79 100644 --- a/docs/3.x.x/en/migration/migration-guide-alpha-10-to-alpha-11.md +++ b/docs/3.x.x/en/migration/migration-guide-alpha-10-to-alpha-11.md @@ -43,5 +43,8 @@ Copy the fields and relations you had in your `/plugins/users-permissions/models Then, delete your old `plugins` folder and replace it by the new one. +## Update the Dependencies + +Now let's update the dependencies in your `package.json` we edited earlier. Simply run `npm install`: That's all, you have now upgraded to Strapi `alpha.11`. From 17e93402765f8661a6e47befa4bab80e44413e10 Mon Sep 17 00:00:00 2001 From: soupette Date: Mon, 14 May 2018 14:17:51 +0200 Subject: [PATCH 2/3] Fixes #870 --- .../lib/internals/eslint/.eslintrc.json | 1 + .../admin/src/containers/EditPage/saga.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/packages/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json b/packages/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json index 90307507bb..99efddbd87 100755 --- a/packages/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json +++ b/packages/strapi-helper-plugin/lib/internals/eslint/.eslintrc.json @@ -93,6 +93,7 @@ "react/require-default-props": 2, "no-undef": 0, "react/no-array-index-key": 0, + "react/sort-comp": 0, "react/jsx-handler-names": [ 2, { diff --git a/packages/strapi-plugin-content-manager/admin/src/containers/EditPage/saga.js b/packages/strapi-plugin-content-manager/admin/src/containers/EditPage/saga.js index b5cfa4c9f2..58404accd6 100644 --- a/packages/strapi-plugin-content-manager/admin/src/containers/EditPage/saga.js +++ b/packages/strapi-plugin-content-manager/admin/src/containers/EditPage/saga.js @@ -41,6 +41,16 @@ function* dataGet(action) { call(request, '/content-manager/layout', { method: 'GET', params }), ]; const pluginHeaderTitle = yield call(templateObject, { mainField: action.mainField }, response); + + // Remove the updated_at field so it is updated correctly when using Postgres or MySQL db + if (response.updated_at) { + delete response.updated_at; + } + + // Remove the updatedAt field so it is updated correctly when using MongoDB + if (response.updatedAt) { + delete response.updatedAt; + } yield put(getDataSucceeded(action.id, response, pluginHeaderTitle.mainField)); yield put(getLayoutSucceeded(layout)); } catch(err) { From de22d0e1304fc2c039bcbde2040e2e7677022237 Mon Sep 17 00:00:00 2001 From: soupette Date: Mon, 14 May 2018 15:02:30 +0200 Subject: [PATCH 3/3] Remove createdAt fields as well --- .../admin/src/containers/EditPage/saga.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/strapi-plugin-content-manager/admin/src/containers/EditPage/saga.js b/packages/strapi-plugin-content-manager/admin/src/containers/EditPage/saga.js index 58404accd6..727b1f8f85 100644 --- a/packages/strapi-plugin-content-manager/admin/src/containers/EditPage/saga.js +++ b/packages/strapi-plugin-content-manager/admin/src/containers/EditPage/saga.js @@ -42,15 +42,19 @@ function* dataGet(action) { ]; const pluginHeaderTitle = yield call(templateObject, { mainField: action.mainField }, response); - // Remove the updated_at field so it is updated correctly when using Postgres or MySQL db + // Remove the updated_at & created_at fields so it is updated correctly when using Postgres or MySQL db if (response.updated_at) { + delete response.created_at; delete response.updated_at; } - // Remove the updatedAt field so it is updated correctly when using MongoDB + // Remove the updatedAt & createdAt fields so it is updated correctly when using MongoDB if (response.updatedAt) { + delete response.createdAt; delete response.updatedAt; + } + yield put(getDataSucceeded(action.id, response, pluginHeaderTitle.mainField)); yield put(getLayoutSucceeded(layout)); } catch(err) {