From b17f5647e94a05e2ae6d17bf1ec8cd7fb3f5ed81 Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Thu, 19 Jan 2023 15:02:52 +0100 Subject: [PATCH 01/10] add server webhooks populateRelations config variable --- .../setup-deployment-guides/configurations/required/server.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md index 2c865a55cd..5364f186df 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md @@ -32,6 +32,7 @@ The `./config/server.js` file can include the following parameters: | `cron.tasks` | Declare [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to be run at specific dates. | object | | | `dirs` | Path configuration of different directories Strapi uses. | object | | | `dirs.public` | Customize the path of the public folder. | string | `./public` | +| `webhooks.populateRelations` | For compatibility reasons is set to true, and it will be removed in the next major release. We recommend to set it to false if you don't need it. | boolean | `true` | ## Configurations @@ -130,6 +131,7 @@ export default ({ env }) => ({ }, }); ``` + From d35bd7e7e09f0339b3872b5b32ce6d2706d0566f Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 20 Jan 2023 09:42:12 +0100 Subject: [PATCH 02/10] Update docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md Co-authored-by: Pierre Wizla --- .../setup-deployment-guides/configurations/required/server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md index 5364f186df..7931033f07 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md @@ -32,7 +32,7 @@ The `./config/server.js` file can include the following parameters: | `cron.tasks` | Declare [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to be run at specific dates. | object | | | `dirs` | Path configuration of different directories Strapi uses. | object | | | `dirs.public` | Customize the path of the public folder. | string | `./public` | -| `webhooks.populateRelations` | For compatibility reasons is set to true, and it will be removed in the next major release. We recommend to set it to false if you don't need it. | boolean | `true` | +| `webhooks.populateRelations` | For compatibility reasons, it is set to `true` and will be removed in the next major release. We recommend setting it to `false` if you don't need it. | boolean | `true` | ## Configurations From 10726938942b174dd523ad291cd5f0941c83cd8e Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Mon, 23 Jan 2023 15:38:41 +0100 Subject: [PATCH 03/10] Auto stash before merge of "dev/webhook-populated-relations" and "origin/dev/webhook-populated-relations" --- .../setup-deployment-guides/configurations/required/server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md index 7931033f07..7b3a9441e2 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md @@ -32,7 +32,7 @@ The `./config/server.js` file can include the following parameters: | `cron.tasks` | Declare [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to be run at specific dates. | object | | | `dirs` | Path configuration of different directories Strapi uses. | object | | | `dirs.public` | Customize the path of the public folder. | string | `./public` | -| `webhooks.populateRelations` | For compatibility reasons, it is set to `true` and will be removed in the next major release. We recommend setting it to `false` if you don't need it. | boolean | `true` | +| `webhooks.populateRelations` | For compatibility reasons, it is set to `true`. We recommend setting it to `false` if you don't need it. | boolean | `true` | ## Configurations From c44bab515c4be1288a52c447ab0f700b967d1ee7 Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Wed, 25 Jan 2023 15:29:52 +0100 Subject: [PATCH 04/10] add 4.6.1 migration guide --- .../migration-guides.md | 1 + .../v4/migration-guide-4.5.1-to-4.6.1.md | 69 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides.md b/docs/developer-docs/latest/update-migration-guides/migration-guides.md index 747bd60d13..61870fec67 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides.md @@ -22,6 +22,7 @@ Migrations are necessary when upgrades to Strapi include breaking changes. The m - [Migration guide from 4.3.6 to 4.3.8](migration-guides/v4/migration-guide-4.3.6-to-4.3.8.md) - [Migration guide from 4.4.3 to 4.4.5](migration-guides/v4/migration-guide-4.4.3-to-4.4.5.md) - [Migration guide from 4.4.5 to 4.5.1](migration-guides/v4/migration-guide-4.4.5-to-4.5.1.md) +- [Migration guide from 4.5.1 to 4.6.1](migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md) ## v3 to v4 migration guides diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md new file mode 100644 index 0000000000..48041fd4ea --- /dev/null +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md @@ -0,0 +1,69 @@ +--- +title: Migrate from 4.5.1 to 4.6.1 - Strapi Developer Docs +description: Learn how you can migrate your Strapi application from 4.5.1 to 4.6.1. +canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.html +--- + +# v4.5.1 to v4.6.1 migration guide + +The Strapi v4.5.1 to v4.6.1 migration guide upgrades v4.5.1 to v4.6.1. We introduced a configuration for webhooks to receive populated relations. The migration guide consists of: + +- Upgrading the application dependencies +- Changing the webhooks configuration (optional) +- Reinitializing the application + +## Upgrading the application dependencies to 4.6.1 + +:::prerequisites +Stop the server before starting the upgrade. +::: + +1. Upgrade all of the Strapi packages in `package.json` to `4.6.1`: + + ```json + // path: package.json + + { + // ... + "dependencies": { + "@strapi/strapi": "4.6.1", + "@strapi/plugin-users-permissions": "4.6.1", + "@strapi/plugin-i18n": "4.6.1" + // ... + } + } + ``` + +2. Save the edited `package.json` file. + +3. Run either `yarn` or `npm install` to install the new version. + +::: tip +If the operation doesn't work, try removing your `yarn.lock` or `package-lock.json`. If that doesn't help, remove the `node_modules` folder as well and try again. +::: + +## Changing the webhooks configuration (optional) + +By default, and for backwards compatibility reasons, webhooks will receive the populated relations. We do recommend to disable this behavior if you don't need it. + +If you want to change this behavior, you can do so by editing the `./config/server.js` file (or `/config/server.ts` if you are using TypeScript) and add the following configuration: + +```jsx +'use strict'; + +module.exports = ({ env }) => ({ + host: env('HOST', '0.0.0.0'), + port: env.int('PORT', 1337), + url: 'http://localhost:1337', + webhooks: { + // <--- Add this to not receive populated relations in webhooks + populateRelations: false, + }, +}); +``` + +With this, you will no longer receive populated relations in webhooks, and **response times on the Content Manager will be faster**. + +You can see more of the available configuration options in the [server configuration documentation](/developer-docs/latest/setup-deployment-guides/configurations/required/server.md). + +!!!include(developer-docs/latest/update-migration-guides/migration-guides/v4/snippets/Rebuild-and-start-snippet.md)!!! From cb0e27a0e8e1786e5b12404881d19471025d0748 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 1 Feb 2023 12:24:55 +0100 Subject: [PATCH 05/10] Update docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pierre Noël --- .../setup-deployment-guides/configurations/required/server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md index 7b3a9441e2..788b7291ef 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md @@ -32,7 +32,7 @@ The `./config/server.js` file can include the following parameters: | `cron.tasks` | Declare [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to be run at specific dates. | object | | | `dirs` | Path configuration of different directories Strapi uses. | object | | | `dirs.public` | Customize the path of the public folder. | string | `./public` | -| `webhooks.populateRelations` | For compatibility reasons, it is set to `true`. We recommend setting it to `false` if you don't need it. | boolean | `true` | +| `webhooks.populateRelations` | For backward compatibility reasons, the default value is `true`, but the recommended value is `false` to avoid performance issues. | boolean | `true` | ## Configurations From 5ffc58cf043abbf80e233e5607c76cf464b31137 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 1 Feb 2023 12:25:04 +0100 Subject: [PATCH 06/10] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pierre Noël --- .../migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md index 48041fd4ea..429d6b2f5e 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md @@ -46,7 +46,7 @@ If the operation doesn't work, try removing your `yarn.lock` or `package-lock.js By default, and for backwards compatibility reasons, webhooks will receive the populated relations. We do recommend to disable this behavior if you don't need it. -If you want to change this behavior, you can do so by editing the `./config/server.js` file (or `/config/server.ts` if you are using TypeScript) and add the following configuration: +If you want to change this behavior, you can do so by editing the `./config/server.js` file (or `./config/server.ts` if you are using TypeScript) and add the following configuration: ```jsx 'use strict'; From d131813eef72567d58724a194a6337517a598f65 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 1 Feb 2023 12:26:05 +0100 Subject: [PATCH 07/10] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pierre Noël --- .../migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md index 429d6b2f5e..09ce63b4e3 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md @@ -62,7 +62,7 @@ module.exports = ({ env }) => ({ }); ``` -With this, you will no longer receive populated relations in webhooks, and **response times on the Content Manager will be faster**. +With this, you will no longer receive populated relations in webhooks, and **response times on the Content Manager will be shorter**. You can see more of the available configuration options in the [server configuration documentation](/developer-docs/latest/setup-deployment-guides/configurations/required/server.md). From c4a58ea09c9c118d88a3dfc7d1d3f7b78202a251 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 1 Feb 2023 14:12:24 +0100 Subject: [PATCH 08/10] Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Pierre Noël --- .../migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md index 09ce63b4e3..65a3858dbc 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md @@ -44,7 +44,7 @@ If the operation doesn't work, try removing your `yarn.lock` or `package-lock.js ## Changing the webhooks configuration (optional) -By default, and for backwards compatibility reasons, webhooks will receive the populated relations. We do recommend to disable this behavior if you don't need it. +By default, and for backward compatibility reasons, webhooks will receive the entity with its relations populated again. We do recommend to disable this behavior if you were not using it, as it may cause performance issues when having many relations. If you need populated relations in your webhook, we recommend doing a separate query in your webhook listenner to fetch the entity only with the necessary data. If you want to change this behavior, you can do so by editing the `./config/server.js` file (or `./config/server.ts` if you are using TypeScript) and add the following configuration: From fccb023d0e9812b7fdd0c3551bed681f9a4951f2 Mon Sep 17 00:00:00 2001 From: Marc-Roig Date: Wed, 1 Feb 2023 14:29:36 +0100 Subject: [PATCH 09/10] improve explanation of webhooks populate relations usage --- .../configurations/required/server.md | 2 +- .../update-migration-guides/migration-guides.md | 2 +- .../v4/migration-guide-4.5.1-to-4.6.1.md | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md index 788b7291ef..d45fc7b091 100644 --- a/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md +++ b/docs/developer-docs/latest/setup-deployment-guides/configurations/required/server.md @@ -32,7 +32,7 @@ The `./config/server.js` file can include the following parameters: | `cron.tasks` | Declare [CRON jobs](/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md) to be run at specific dates. | object | | | `dirs` | Path configuration of different directories Strapi uses. | object | | | `dirs.public` | Customize the path of the public folder. | string | `./public` | -| `webhooks.populateRelations` | For backward compatibility reasons, the default value is `true`, but the recommended value is `false` to avoid performance issues. | boolean | `true` | +| `webhooks.populateRelations` | For backward compatibility reasons, the default value is `true`, but the recommended value is `false` to avoid performance issues when having many relations. If you need populated relations in your webhook, we recommend doing a separate query in your webhook listener to fetch the entity only with the necessary data. | boolean | `true` | ## Configurations diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides.md b/docs/developer-docs/latest/update-migration-guides/migration-guides.md index 61870fec67..e6b5179185 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides.md @@ -22,7 +22,7 @@ Migrations are necessary when upgrades to Strapi include breaking changes. The m - [Migration guide from 4.3.6 to 4.3.8](migration-guides/v4/migration-guide-4.3.6-to-4.3.8.md) - [Migration guide from 4.4.3 to 4.4.5](migration-guides/v4/migration-guide-4.4.3-to-4.4.5.md) - [Migration guide from 4.4.5 to 4.5.1](migration-guides/v4/migration-guide-4.4.5-to-4.5.1.md) -- [Migration guide from 4.5.1 to 4.6.1](migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md) +- [Migration guide from 4.5.1+ to 4.6.1](migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md) ## v3 to v4 migration guides diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md index 65a3858dbc..5d2be00770 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md @@ -1,12 +1,12 @@ --- -title: Migrate from 4.5.1 to 4.6.1 - Strapi Developer Docs -description: Learn how you can migrate your Strapi application from 4.5.1 to 4.6.1. +title: Migrate from 4.5.1+ to 4.6.1 - Strapi Developer Docs +description: Learn how you can migrate your Strapi application from 4.5.1+ to 4.6.1. canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.html --- -# v4.5.1 to v4.6.1 migration guide +# v4.5.1+ to v4.6.1 migration guide -The Strapi v4.5.1 to v4.6.1 migration guide upgrades v4.5.1 to v4.6.1. We introduced a configuration for webhooks to receive populated relations. The migration guide consists of: +The Strapi v4.5.1+ to v4.6.1 migration guide upgrades v4.5.1+ to v4.6.1. We introduced a configuration for webhooks to receive populated relations. The migration guide consists of: - Upgrading the application dependencies - Changing the webhooks configuration (optional) @@ -44,7 +44,7 @@ If the operation doesn't work, try removing your `yarn.lock` or `package-lock.js ## Changing the webhooks configuration (optional) -By default, and for backward compatibility reasons, webhooks will receive the entity with its relations populated again. We do recommend to disable this behavior if you were not using it, as it may cause performance issues when having many relations. If you need populated relations in your webhook, we recommend doing a separate query in your webhook listenner to fetch the entity only with the necessary data. +By default, and for backward compatibility reasons, webhooks will receive the entity with its relations populated again. We do recommend to disable this behavior if you were not using it, as it may cause performance issues when having many relations. If you need populated relations in your webhook, we recommend doing a separate query in your webhook listener to fetch the entity only with the necessary data. If you want to change this behavior, you can do so by editing the `./config/server.js` file (or `./config/server.ts` if you are using TypeScript) and add the following configuration: @@ -56,7 +56,7 @@ module.exports = ({ env }) => ({ port: env.int('PORT', 1337), url: 'http://localhost:1337', webhooks: { - // <--- Add this to not receive populated relations in webhooks + // Add this to not receive populated relations in webhooks populateRelations: false, }, }); From 942f2ef8b50e71c866a1724a03911f6c9f47ae4f Mon Sep 17 00:00:00 2001 From: Marc Date: Mon, 6 Feb 2023 17:54:59 +0100 Subject: [PATCH 10/10] Move sizeLimit one level above in upload provider (#1133) * move sizeLimit one level above in upload provider * add sizeLimit deprecation warning * minor change * minor change * checkFileSize upload provider * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla * Update docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.3.x-to-4.4.x.md Co-authored-by: Pierre Wizla * move migration steps to 4.5.1 to 4.6.1 --------- Co-authored-by: Pierre Wizla --- .../latest/development/providers.md | 5 ++ docs/developer-docs/latest/plugins/upload.md | 6 +- .../v4/migration-guide-4.5.1-to-4.6.1.md | 65 ++++++++++++++++++- 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/docs/developer-docs/latest/development/providers.md b/docs/developer-docs/latest/development/providers.md index 4cb30d513f..04a19a3010 100644 --- a/docs/developer-docs/latest/development/providers.md +++ b/docs/developer-docs/latest/development/providers.md @@ -151,6 +151,11 @@ module.exports = { delete(file) { // delete the file in the provider }, + checkFileSize(file, { sizeLimit }) { + // implement your own file size limit logic + // there is a default logic in place if this + // method is not implemented + }, }; }, }; diff --git a/docs/developer-docs/latest/plugins/upload.md b/docs/developer-docs/latest/plugins/upload.md index cb25dda41c..1cc5b04105 100644 --- a/docs/developer-docs/latest/plugins/upload.md +++ b/docs/developer-docs/latest/plugins/upload.md @@ -135,7 +135,7 @@ export default [ -In addition to the middleware configuration, you can pass the `sizeLimit`, which is an integer in bytes, in the `providerOptions` of the [plugin configuration](/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md) in `./config/plugins.js`: +In addition to the middleware configuration, you can pass the `sizeLimit`, which is an integer in bytes, in the [plugin configuration](/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md) in `./config/plugins.js`: @@ -148,9 +148,7 @@ module.exports = { // ... upload: { config: { - providerOptions: { - sizeLimit: 250 * 1024 * 1024 // 256mb in bytes - } + sizeLimit: 250 * 1024 * 1024 // 256mb in bytes } } }; diff --git a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md index 5d2be00770..b869df6a99 100644 --- a/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md +++ b/docs/developer-docs/latest/update-migration-guides/migration-guides/v4/migration-guide-4.5.1-to-4.6.1.md @@ -6,10 +6,13 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/update-migration-guid # v4.5.1+ to v4.6.1 migration guide -The Strapi v4.5.1+ to v4.6.1 migration guide upgrades v4.5.1+ to v4.6.1. We introduced a configuration for webhooks to receive populated relations. The migration guide consists of: +The Strapi v4.5.1+ to v4.6.1 migration guide upgrades v4.5.1+ to v4.6.1. We introduced a configuration for webhooks to receive populated relations. Also, this migration guide is needed for all users who were limiting media size for the local upload provider. + +The migration guide consists of: - Upgrading the application dependencies - Changing the webhooks configuration (optional) +- Updating the local upload provider `sizeLimit` - Reinitializing the application ## Upgrading the application dependencies to 4.6.1 @@ -66,4 +69,64 @@ With this, you will no longer receive populated relations in webhooks, and **res You can see more of the available configuration options in the [server configuration documentation](/developer-docs/latest/setup-deployment-guides/configurations/required/server.md). +## Updating the sizeLimit provider configuration + +This step is only required if you were using the [`sizeLimit` configuration](/developer-docs/latest/plugins/upload.md#max-file-size) for your upload provider. + +:::caution +The documentation required the `sizeLimit` to be in bytes, but it was actually in kilobytes. This is now fixed, and the limit will be interpreted as bytes. + +If you, for some reason, were limiting the file size to kilobytes, you should update the value to be in bytes. +::: + +We recommend to move the `sizeLimit` outside the provider options like the following, as it will be deprecated in the next major version. + + + + +```js +// path: ./config/plugins.js + +module.exports = { + // ... + upload: { + config: { + sizeLimit: 250 * 1024 * 1024 // Now + providerOptions: { + sizeLimit: 250 * 1024 * 1024 // Before + } + } + } +}; +``` + + + + + +```js +// path: ./config/plugins.ts + +export default { + // ... + upload: { + config: { + sizeLimit: 250 * 1024 * 1024 // Now + providerOptions: { + sizeLimit: 250 * 1024 * 1024 // Before + } + } + } +}; +``` + + + + + +To change the script: + +1. In the `./config/plugins.js` file, identify the upload configuration if you have one. +2. (_optional_) If you have a `sizeLimit`, move it one level above `providerOptions`. + !!!include(developer-docs/latest/update-migration-guides/migration-guides/v4/snippets/Rebuild-and-start-snippet.md)!!!