How I upgraded to Drupal 9.0.0-alpha1
Matthew Grasmick’s screencast about upgrading to Drupal 9 made me think it would be really fascinating if I also upgraded my site to Drupal 9 by keeping all the functionalities, including all the contributed extensions this site uses. No surprises – it took me more than 15 minutes 😶. And now, I’ll tell you, why.
This post is a list of the modules affected by the BC features removed from Drupal 9-alpha1, grouped by the change records.
Core version requirement key in info.yml
files
- Admin Toolbar (including submodules admin_toolbar_links_access_filter and admin_toolbar_tools)
- Adminimal Admin Toolbar
- Adminimal Theme
- AdvAgg
- Bootstrap (8.x-3.x)
- CAPTCHA
- Codesnippet
- CodeTag
- Config Ignore
- Configuration Rewrite
Deprecated unmanaged file functions replaced with a service
These functions are: file_prepare_directory()
, file_unmanaged_copy()
, file_unmanaged_move()
, file_unmanaged_save_data()
, file_unmanaged_delete()
etc.
- AdvAgg
- Bootstrap (8.x-3.x)
- Configuration Rewrite
Several file URI/scheme functions deprecated and moved to \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface
- AdvAgg
Use mb_*
functions instead of Unicode::*
methods
- Bootstrap (8.x-3.x)
drupal_get_message()
and drupal_set_message()
replaced by Messenger service
- Bootstrap (8.x-3.x)
- EntityManager has been split into 11 classes
- Codesnippet
Other Issues
- The Crop API module has a condition in its
hook_requirements()
implementation which assumes that the module is installed to Drupal core ^8 – and it only checks the minor version of the actual core.
So I had to apply this patch:
1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/crop.install b/crop.install
index 9d4fa79..771b801 100644
--- a/crop.install
+++ b/crop.install
@@ -18,7 +18,7 @@ function crop_requirements($phase) {
// media_entity 1.x enabled.
$incompatible = FALSE;
$drupal_version = explode('.', \Drupal::VERSION);
- if ($drupal_version[1] < 4) {
+ if ($drupal_version[0] === 8 && $drupal_version[1] < 4) {
$incompatible = TRUE;
}
elseif (\Drupal::moduleHandler()->moduleExists('media_entity')) {
- I also fixed something in the Paragraphs module’s ParagraphSelection handler.