|
| 1 | +# Upgrade to Plone 6.0 |
| 2 | + |
| 3 | +Plone 6.0 has seen the following major changes. |
| 4 | +Some may require changes in your setup. |
| 5 | + |
| 6 | +## Removed portal_quickinstaller |
| 7 | +Plone no longer ships with the `portal_quickinstaller` tool (`CMFQuickInstallerTool`). |
| 8 | +In existing sites, the standard upgrade will remove the tool. |
| 9 | +This is the final step in a deprecation path that started in Plone 5.1. |
| 10 | +Documentation on how to switch to GenericSetup and the new installer, can be seen in the old [Plone 5.1 upgrade guide]( |
| 11 | +https://docs.plone.org/develop/addons/upgrade_to_51.html#installation-code). |
| 12 | + |
| 13 | +See [PLIP 1775](https://github.com/plone/Products.CMFPlone/issues/1775). |
| 14 | + |
| 15 | + |
| 16 | +## Dexterity site root |
| 17 | +For content types, in Plone 4 and 5 you had the option to use the old Archetypes or the new Dexterity framework. |
| 18 | +The Plone Site root object was neither: it was in its own class. |
| 19 | +In Plone 6, the site root itself is a Dexterity object. |
| 20 | + |
| 21 | +When you upgrade a site from Plone 5.2 to 6.0, at first you will see an empty site root. |
| 22 | +Do not panic. |
| 23 | +Your contents are only temporarily invisible. |
| 24 | +Simply perform the standard migration via the `@@plone-upgrade` view and your content will be visible again. |
| 25 | + |
| 26 | +See [PLIP 2454](https://github.com/plone/Products.CMFPlone/issues/2454). |
| 27 | + |
| 28 | + |
| 29 | +## Volto |
| 30 | +Plone 6 ships with a new NodeJS frontend: Volto. |
| 31 | +When you use the `Plone` package in your project, you will get the `plone.volto` integration package. |
| 32 | +This package prepares your Plone Site as a REST API. |
| 33 | + |
| 34 | +Note: the classic integrated frontend is still available if you are not ready for the new separate frontend. |
| 35 | +Do not use the `plone.volto` package then. |
| 36 | + |
| 37 | +See [PLIP 2703](https://github.com/plone/Products.CMFPlone/issues/2703). |
| 38 | + |
| 39 | + |
| 40 | +## Archetypes |
| 41 | +The deprecated Archetypes contenttypes framework is no longer supported. |
| 42 | +Add-ons that define a contenttype, must use Dexterity instead. |
| 43 | + |
| 44 | +See [PLIP 2775](https://github.com/plone/Products.CMFPlone/issues/2775). |
| 45 | + |
| 46 | + |
| 47 | +## No more temp_folder / tempstorage |
| 48 | + |
| 49 | +The `temp_folder` object in the Zope root is no longer created by default. |
| 50 | +If the object is there, but it is broken, the standard Plone upgrade procedure will remove it. |
| 51 | + |
| 52 | +For now, you must explicitly disable the temp_folder if you use buildout: |
| 53 | + |
| 54 | +``` |
| 55 | +[instance] |
| 56 | +recipe = plone.recipe.zope2instance |
| 57 | +zodb-temporary-storage = off |
| 58 | +``` |
| 59 | + |
| 60 | +See [issue 2957](https://github.com/plone/Products.CMFPlone/issues/2957). |
| 61 | + |
| 62 | + |
| 63 | +## Changed Templates to Bootstrap 5 Markup |
| 64 | + |
| 65 | +All templates in core Plone have been updated to Bootstrap 5 markup. |
| 66 | +Add-on authors are encouraged to do the same. |
| 67 | +If you have customized a core template, you should check if your change is still needed, and update it to fit the new markup. |
| 68 | +Any CSS and JavaScript that relies on a specific structure, or certain ids or classes, should be checked as well. |
| 69 | + |
| 70 | +See [PLIP 2967](https://github.com/plone/Products.CMFPlone/issues/2967). |
| 71 | + |
| 72 | + |
| 73 | +## Zope 5 |
| 74 | + |
| 75 | +Plone 6.0 means we move from Zope 4 to 5. |
| 76 | +This drops support for Python 2.7, drops ZServer, and removes deprecated code. |
| 77 | +See [Zope 5.0a1](https://zope.readthedocs.io/en/latest/changes.html#a1-2020-02-28). |
| 78 | + |
| 79 | +Some imports may need to change. |
| 80 | +Add-on authors should check on Plone 5.2 if their code runs without any deprecation warnings from Zope 4. |
| 81 | +If no warnings are shown, the add-on should run fine on Zope 5. |
| 82 | + |
| 83 | +See [PLIP 3058](https://github.com/plone/Products.CMFPlone/issues/3058). |
| 84 | + |
| 85 | + |
| 86 | +## Modernize Plone default theme (Barceloneta LTS) |
| 87 | + |
| 88 | +The standard theme in Classic UI was updated to Bootstrap 5, CSS variables, and an icon library. |
| 89 | +If you have a theme that builds on Barceloneta, you most likely need various changes. |
| 90 | + |
| 91 | +It may be best to start with a fresh theme, and try to keep the changes minimal. |
| 92 | +The training documentation lists [three possible theming strategies](https://training.plone.org/5/theming/index.html): |
| 93 | + |
| 94 | +- Create a theme based on Barceloneta |
| 95 | +- Create a theme from scratch |
| 96 | +- Create a theme based on Diazo |
| 97 | + |
| 98 | +See [PLIP 3061](https://github.com/plone/Products.CMFPlone/issues/3061). |
| 99 | + |
| 100 | + |
| 101 | +## Python |
| 102 | + |
| 103 | +You may need to use a newer Python version. |
| 104 | +Supported Python versions are: 3.7, 3.8 and 3.9. |
| 105 | +We recommend the most recent version. |
| 106 | +See https://www.python.org/downloads/ for which Python version is still supported by the Python community. |
| 107 | + |
| 108 | +See [PLIP 3229](https://github.com/plone/Products.CMFPlone/issues/3229). |
| 109 | + |
| 110 | + |
| 111 | +## `plone.api.relation` |
| 112 | + |
| 113 | +The `plone.api` package now has a `relation` module. Add-on authors may want to use this to get, create or delete relations. |
| 114 | + |
| 115 | +See [PLIP 3137](https://github.com/plone/Products.CMFPlone/issues/3137). |
| 116 | + |
| 117 | + |
| 118 | +## Mockup and resource registry redone |
| 119 | + |
| 120 | +Mockup contains the source of most Classic Plone JavaScript. |
| 121 | +The compiled version is in `plone.staticresources`. |
| 122 | + |
| 123 | +Mockup is now based on Patternslib 4. |
| 124 | +It uses ES6 module imports instead of RequireJS. |
| 125 | +Add-ons for Classic Plone that use JavaScript should be updated to use ES6 modules as well. |
| 126 | + |
| 127 | +The resource registries and their control panel have been simplified. |
| 128 | +Add-ons for Classic Plone only need to register bundles, not individual resources. |
| 129 | + |
| 130 | +See [PLIP 3211](https://github.com/plone/Products.CMFPlone/issues/3211). |
| 131 | + |
| 132 | + |
| 133 | +## Relations control panel |
| 134 | + |
| 135 | +Plone 6 has a new control panel for relations: `@@inspect-relations`. |
| 136 | +As Manager you may want to use this control panel to look for and fix possible problems. |
| 137 | + |
| 138 | +See [PLIP 3232](https://github.com/plone/Products.CMFPlone/issues/3232). |
| 139 | + |
| 140 | + |
| 141 | +## Deprecated unicode property types |
| 142 | + |
| 143 | +Zope 5 has deprecated the unicode property types: ustring, ulines, utext, utokens. |
| 144 | +If you use these in your add-on, you should switch to their standard variants: string, lines, text, tokens. |
| 145 | +These behave exactly the same on Python 3. |
| 146 | +Plone has an upgrade step that goes through all objects in the site, replacing the deprecated properties with the default ones, so you should not see them anymore. |
| 147 | +But in your own code you should avoid adding them again. |
| 148 | + |
| 149 | +See [issue 3305](https://github.com/plone/Products.CMFPlone/issues/3305). |
| 150 | + |
| 151 | + |
| 152 | +## autoinclude |
| 153 | + |
| 154 | +We have replaced `z3c.autoinclude` with `plone.autoinclude`. |
| 155 | +Both are used by add-ons (Python packages) to signal with an entry point that Plone must load the zcml of the add-on. |
| 156 | +In most cases, the existing entry point can stay the same, for example in `setup.py`: |
| 157 | + |
| 158 | +``` |
| 159 | +entry_points=""" |
| 160 | +[z3c.autoinclude.plugin] |
| 161 | +target = plone |
| 162 | +""" |
| 163 | +``` |
| 164 | + |
| 165 | +When your package name differs from your module name, so what you import in Python, you need a different entry point. |
| 166 | +When your module is called `example.alternative`, create this entry point: |
| 167 | + |
| 168 | +``` |
| 169 | +entry_points=""" |
| 170 | +[plone.autoinclude.plugin] |
| 171 | +target = plone |
| 172 | +module = example.alternative |
| 173 | +""" |
| 174 | +``` |
| 175 | + |
| 176 | +A second change that may influence add-ons, is that the `includeDependencies` directive is no longer supported. |
| 177 | +It was already recommended not to use this directive, as it is too implicit. |
| 178 | +In the zcml files of your add-on, search for `includeDependencies`. |
| 179 | +If you find it, you must replace it by explicitly loading any zcml from other packages that the add-on needs. |
| 180 | +Sample change from [`dexterity.membrane`](https://github.com/collective/dexterity.membrane/pull/60): |
| 181 | + |
| 182 | +``` |
| 183 | +- <includeDependencies package="." /> |
| 184 | ++ <include package="Products.membrane" /> |
| 185 | +``` |
| 186 | + |
| 187 | +The same change is needed for the no longer supported `includeDependenciesOverrides` directive, which may be used in `overrides.zcml`. |
| 188 | + |
| 189 | +See [PLIP 3339](https://github.com/plone/Products.CMFPlone/issues/3339). |
| 190 | +Also see the [`plone.autoinclude`](https://github.com/plone/plone.autoinclude) documentation. |
0 commit comments