You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/update_and_migration/from_4.6/update_to_5.0.md
+51-48Lines changed: 51 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Before you update to v5.0, you need to [update to the latest maintenance release
11
11
12
12
### Move from old to new Commerce
13
13
14
-
If circa v4.3 you kept [deprecated old Commerce packages](update_from_4.3_old_commerce.md),
14
+
If you've chosen to use the [deprecated Commerce packages](update_from_4.3_old_commerce.md) during the update to 4.4,
15
15
you have to move to [new Commerce ones](update_from_4.3_new_commerce.md).
16
16
17
17
## Update from v4.6.latest to v5.0.0
@@ -35,12 +35,14 @@ Install [`ibexa/rector`](https://github.com/ibexa/rector) which contains rules t
35
35
composer require --dev ibexa/rector
36
36
```
37
37
38
-
Customize the `rector.php` config file.
39
-
Make it match your directory structure (for example, you may have to remove the `tests` directory).
40
-
You can add rules [for PHP with `withPhpSets`](https://getrector.com/documentation/set-lists#content-php-sets)
41
-
or [for Symfony with `withComposerBased`](https://getrector.com/blog/introducing-composer-version-based-sets).
42
-
It's recommended to activate one rule set at a time, run a first time with the `--dry-run` option,
43
-
check the output, and decide if kept right now, or discarded for another time.
38
+
Customize the `rector.php` config file by:
39
+
40
+
- making it match your directory structure (for example, you may not have the `tests` directory)
41
+
- adding project-specific rules:
42
+
- specify [PHP rules by using `withPhpSets`](https://getrector.com/documentation/set-lists#content-php-sets)
43
+
- specify [Symfony, Twig, or Doctrine rules by using `withComposerBased`](https://getrector.com/documentation/composer-based-sets).
44
+
45
+
It's recommended to activate one rule set at a time and preview the output by running Rector with the `--dry-run` option to decide which rulesets should be used and in which order.
44
46
45
47
Your configuration could look like the following example:
you have to move from`type: annotation` to `type: attribute`.
76
+
change all occurrences of`type: annotation` to `type: attribute`.
75
77
76
-
The `config/routes.yaml` file should start with the following declaration from [its recipe](https://github.com/symfony/recipes/blob/main/symfony/routing/7.0/config/routes.yaml):
78
+
The `config/routes.yaml` file should start with the following declaration from the [Symfony recipe](https://github.com/symfony/recipes/blob/main/symfony/routing/7.0/config/routes.yaml):
77
79
78
80
```yaml
79
81
controllers:
@@ -83,13 +85,12 @@ controllers:
83
85
type: attribute
84
86
```
85
87
86
-
- You can delete the file and let the recipe recreate it.
87
-
Then, if you have eventually customized it, merge with your previous version from your version system.
88
-
- Or edit the file and copy-paste the new declaration on top of it.
88
+
You can add the new declaration to the top of the file manually, or recreate the file by running `composer sync-recipes symfony/routing --force --reset`
89
89
90
90
### Remove GraphQL schema
91
91
92
-
4.6 GraphQL schema isn't compatible with 5.0 so delete it, for example, with the following command:
92
+
The GraphQL schema used in 4.6 isn't compatible with version 5.0 and must be deleted.
93
+
You can do it, for example, with the following command:
93
94
94
95
```bash
95
96
rm -r config/graphql
@@ -101,8 +102,9 @@ rm -r config/graphql
101
102
102
103
[[= product_name =]] 5.0 is based on Symfony 7.3 and both must be updated.
103
104
Your development package must be updated as well.
104
-
The process example below considers [`symfony/debug-pack`](https://symfony.com/packages/Debug%20Pack) and `ibexa/rector` as installed.
105
-
Notice that it uses the `--no-update` option to only edit the composer.json, to not run package installation, and to not run scripts until all necessary changes are made.
105
+
The example below assumes that [`symfony/debug-pack`](https://symfony.com/packages/Debug%20Pack) and `ibexa/rector` are installed.
106
+
Adjust the list based on your project requirements.
107
+
Notice the use of the `--no-update` option to only edit the `composer.json` entries and avoid triggering the package update and Composer scripts.
106
108
107
109
=== "[[= product_name_headless =]]"
108
110
@@ -182,16 +184,16 @@ Notice that it uses the `--no-update` option to only edit the composer.json, to
182
184
#### Remove 4.6 LTS Updates constraints
183
185
184
186
4.6 LTS Update packages are included by default in 5.0.
185
-
You can now remove them from your composer.json
186
-
so you don't have to maintain which of their versions your composer.json is referring to.
187
+
Remove them from your composer.json to avoid updating their version manually with each update.
187
188
188
-
For example, the following command removes several formerly LTS Update packages from `composer.json:
189
+
For example, the following command removes all of the released LTS Updates for 4.6 from `composer.json`:
189
190
190
191
```bash
191
192
composer remove --no-update \
192
193
ibexa/connector-ai \
193
-
ibexa/collaboration \
194
-
ibexa/share \
194
+
ibexa/connector-openai \
195
+
ibexa/product-catalog-date-time-attribute \
196
+
ibexa/product-catalog-symbol-attribute/
195
197
ibexa/discounts \
196
198
ibexa/discounts-codes \
197
199
;
@@ -200,7 +202,7 @@ composer remove --no-update \
200
202
#### Remove PHP 8.2 error handler
201
203
202
204
If you were using the [`Php82HideDeprecationsErrorHandler`](update_from_4.6.md#v468) to avoid deprecation messages,
As this is made for all the editions at once, you may encounter unimportant errors on other editions which can be ignored.
297
+
As this script targets all editions, on editions lower than Commerce you may encounter errors about missing tables which can safely be ignored.
296
298
297
299
Many tables and columns are renamed.
298
300
If you have custom code directly querying those, you will need to update them.
@@ -385,7 +387,7 @@ You can track the renaming in the `ibexa-4.6.latest-to-5.0.0.sql` file or below.
385
387
??? note "DFS (Distributed File System)"
386
388
387
389
If [DFS IO handler](clustering.md#dfs-io-handler) is used and, as recommended, its table is on its own database, you'll have to rename table and columns there.
388
-
Here are the DFS renamming queries (extracted from `ibexa-4.6.latest-to-5.0.0.sql`):
390
+
Here are the DFS renaming queries (extracted from `ibexa-4.6.latest-to-5.0.0.sql`):
389
391
390
392
```sql
391
393
ALTER TABLE ezdfsfile RENAME TO ibexa_dfs_file;
@@ -401,7 +403,7 @@ Features which were optional 4.6 LTS Updates are now part of 5.0.0.
401
403
402
404
* If you have already installed the feature, its schema has been updated by the previous step.
403
405
* If you haven't installed the feature, you need to add its schema to your database.
404
-
* If you mistakenly reinstall a schema, no worries, you encounter "Table already exists" errors which can be ignored.
406
+
* If you mistakenly reinstall a schema, you might encounter "Table already exists" errors which can be ignored.
You can add some other rule sets (like, for example, the Symfony ones) to match newer standards.
517
+
You can adjust the other rule sets (for example, the Symfony ones) to match higher versions.
516
518
517
-
Again, it's recommended to activate one set at a time, run a first time with the `--dry-run` option,
518
-
check the output, and decide if kept right now, or discarded for another time.
519
-
As the gap is larger, many rules can be considered, see a selection in the example below.
519
+
Again, it's recommended to activate one rule set at a time and preview the output by running Rector with the `--dry-run` option to decide which rulesets should be used and in which order.
520
+
521
+
As this update spans across a broad range of versions, multiple rules can be considered as in the example below.
520
522
521
523
```php
522
524
//…
@@ -586,19 +588,20 @@ In the following example, you can see optimization thanks to the following featu
586
588
587
589
#### Update JavaScript
588
590
589
-
If you haven't renamed your Webpack file since 3.3,
590
-
you have to do it as 5.0 doesn't support the old names like 4.6 does.
591
+
If you haven't renamed your Webpack file since 3.3, do it now as v5.0 no longer supports the old names.
`ibexa/rector` 5.0 also come with the [JavaScript Transform module](https://github.com/ibexa/rector/blob/v5.0.0/js/README.md) to help you maintain your JS.
599
+
`ibexa/rector`5.0 also comes with the [JavaScript Transform module](https://github.com/ibexa/rector/blob/v5.0.0/js/README.md) to help you maintain your JavaScript code.
600
+
601
+
Customize the `rector.config.js` config file by:
599
602
600
-
Customize the `rector.config.js` config file.
601
-
Make it match your directory structure. Eventually modify the enabled plugin list.
603
+
- making it match your directory structure
604
+
- modifying the list of enabled plugins and their configuration
602
605
603
606
The example below is made to fix in place the JS files from `asset/js/` directory,
604
607
and is ready to enable plugin rule sets one at a time (plugin path is relative to `vendor/ibexa/rector/` directory).
Old identifiers are still supported, but it's recommended to migrate as soon as possible
648
-
and to include this action to the current version update task list.
650
+
The old identifiers are still supported, but it's recommended to migrate as soon as possible.
649
651
650
652
You can list existing field type services with the command `php bin/console debug:container --tag=ibexa.field_type`.
651
653
The output as an `alias` column with new identifiers and a `legacy_alias` column with the old identifiers.
@@ -690,16 +692,17 @@ The output as an `alias` column with new identifiers and a `legacy_alias` column
690
692
| ezurl | ibexa_url |
691
693
| ezuser | ibexa_user |
692
694
693
-
You may have to update them in several places.
695
+
```suggestion
696
+
You may have to update them in several places, for example:
694
697
695
-
- Update in templates to display or edit fields or their definition. For example, in a `@IbexaCore/content_fields.html.twig` extension, `{% block ezstring_field %)` must be changed for `{% block ibexa_string_field %}`
696
-
- Update in migration files
698
+
- Update the field identifiers in templates to display or edit fields or their definition. For example, in a `@IbexaCore/content_fields.html.twig` extension, `{% block ezstring_field %)` must be changed for `{% block ibexa_string_field %}`
699
+
- Update the field identifiers in migration files
697
700
698
701
#### Update icons
699
702
700
-
The names of the icons provided in `all-icons.svg` have changed.
701
-
`ibexa/rector` JavaScript Transform module's plugin `ibexa-rename-icons.js`deals with those changes in JavaScript.
702
-
You may have to update them in other contexts like, for example, config files associating icons to content types or Page Builder blocks.
703
+
The provided built-it icon set has been changed.
704
+
The `ibexa/rector` JavaScript Transform module's plugin `ibexa-rename-icons.js` refactors the icon usage in JavaScript files.
705
+
You may have to update them in other contexts, for example, in configuration files associating icons to content types or Page Builder blocks.
703
706
704
707
You can find an [`ibexa-rename-icons` map in `vendor/ibexa/rector/js/rules.config.json` (`"old-name": "new-name"`)](https://github.com/ibexa/rector/blob/v5.0.0/js/rules.config.json#L63).
705
708
@@ -957,5 +960,5 @@ The following example illustrates the update of a custom page block's icon:
0 commit comments