Error installing / we_megamenu compatibility
Closed this issue ยท 21 comments
I get the same error. Tried PHP 7.4, 8.0, and 8.1.
And just to help people searching for this error: The primary error message is Undefined array key "d_custom_init".
I have exactly the same issue today
Composer 2.2.6
Gulp 2.3.0
NPM 7.5.2
I've added the ticket to our issue queue on drupal.org:
https://www.drupal.org/project/droopler/issues/3265785
Yes, that happens for me as well: Whilst the first error really is a warning only and allows you to continue, this is a real error and a showstopper preventing a completed install.
This is caused by we_megamenu module, which throws deprecation warnings and breaks AJAX calls in the installer. The solution for now is either applying patch https://www.drupal.org/project/we_megamenu/issues/3239043 or changing PHP error reporting level to E_ERROR
for the installation.
This is caused by we_megamenu module, which throws deprecation warnings and breaks AJAX calls in the installer. The solution for now is either applying patch https://www.drupal.org/project/we_megamenu/issues/3239043 or changing PHP error reporting level to
E_ERROR
for the installation.
I will apply and confirm
Just tried patching, but unfortunately, the error above persists.
Still cannot build a working site.
Are you sure the patch is working? I checked this one yesterday, and it worked
composer require cweagans/composer-patches
"patches": {
"drupal/we_megamenu": {
"Fix deprecations": "https://www.drupal.org/files/issues/2022-02-24/we_megamenu_deprecated.patch"
}
}
Running composer install
claims:
- Installing drush/drush (10.6.2): Extracting archive
- Applying patches for drupal/we_megamenu
https://www.drupal.org/files/issues/2022-02-24/we_megamenu_deprecated.patch (Deprecated error/PHP 8.0 Drupal 9)
Package doctrine/reflection is abandoned, you should avoid using it. Use roave/better-reflection instead.
Package webmozart/path-util is abandoned, you should avoid using it. Use symfony/filesystem instead.
Generating autoload files
93 packages you are using are looking for funding.
and I have
"enable-patching": "true",
"patches": {
"drupal/we_megamenu": {
"Deprecated error/PHP 8.0 Drupal 9": "https://www.drupal.org/files/issues/2022-02-24/we_megamenu_deprecated.patch"
}
}
in my composer.json
.
I have now tried setting it up four times: English as language, two times enabling d_blog
and demo content, one time without any additional components at all, and one time enabling all possible components (except for d_commerce
).
Every attempt invariably end up in a WSOD. And no information found in the Apache error.log
.
Maybe you'll be able to install it by drush, this is the full command with all modules:
drush site-install droopler install_configure_form.enable_update_status_module=TRUE install_configure_form.enable_update_status_emails=NULL --db-url='mysql://drupal9:drupal9@database/drupal9' --account-name=admin --account-pass=123 --site-name=droopler -y --locale=en droopler_additional_modules_form.module_d_blog=1 droopler_additional_modules_form.module_d_product=1 droopler_additional_modules_form.init_content=1 droopler_additional_modules_form.documentation=1
Thanks for your suggestion.
Unfortunately, the result looks pretty much as above:
You are about to:
* DROP all tables in your 'droopler_skjaerlund_dk' database.
// Do you want to continue?: yes.
[notice] Starting Drupal installation. This takes a while.
[notice] Performed install task: install_select_language
[notice] Performed install task: install_select_profile
[notice] Performed install task: install_load_profile
[notice] Performed install task: install_verify_requirements
[notice] Performed install task: install_verify_database_ready
[notice] Performed install task: install_base_system
[notice] Performed install task: install_bootstrap_full
[notice] Performed install task: install_profile_modules
[notice] Performed install task: install_profile_themes
[warning] Undefined array key "d_custom_init" ModuleInstaller.php:125
[warning] Attempt to read property "info" on null ModuleInstaller.php:125
[warning] Trying to access array offset on value of type null ModuleInstaller.php:125
[notice] Custom content init not detected.
[notice] Performed install task: install_install_profile
[notice] Performed install task: install_configure_form
[notice] Performed install task: droopler_additional_components_form
[error] Error: Attempt to modify property "col_content" on null in Drupal\we_megamenu\WeMegaMenuBuilder::menuItemInsert() (line 390 of /var/www/web/modules/contrib/we_megamenu/src/WeMegaMenuBuilder.php) #0 /var/www/web/modules/contrib/we_megamenu/we_megamenu.module(700): Drupal\we_megamenu\WeMegaMenuBuilder::menuItemInsert()
#1 [internal function]: we_megamenu_entity_insert()
#2 /var/www/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array()
#3 /var/www/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(251): Drupal\Core\Extension\ModuleHandler->invokeAll()
#4 /var/www/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(897): Drupal\Core\Entity\EntityStorageBase->invokeHook()
#5 /var/www/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(602): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
#6 /var/www/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(782): Drupal\Core\Entity\EntityStorageBase->doPostSave()
#7 /var/www/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(527): Drupal\Core\Entity\ContentEntityStorageBase->doPostSave()
#8 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(802): Drupal\Core\Entity\EntityStorageBase->save()
#9 /var/www/web/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#10 /var/www/web/profiles/contrib/droopler/modules/custom/d_content/modules/d_content_init/d_content_init.module(367): Drupal\Core\Entity\EntityBase->save()
#11 /var/www/web/profiles/contrib/droopler/modules/custom/d_content/modules/d_content_init/d_content_init.module(389): d_content_init_add_node()
#12 /var/www/web/profiles/contrib/droopler/modules/custom/d_content/modules/d_content_init/d_content_init.module(495): d_content_init_add_nodes()
#13 /var/www/web/profiles/contrib/droopler/modules/custom/d_content/modules/d_content_init/d_content_init.module(553): d_content_init_create_all()
#14 /var/www/web/core/includes/batch.inc(295): d_content_init_create_all_batch()
#15 /var/www/web/core/includes/form.inc(954): _batch_process()
#16 /var/www/web/core/includes/install.core.inc(653): batch_process()
#17 /var/www/web/core/includes/install.core.inc(571): install_run_task()
#18 /var/www/web/core/includes/install.core.inc(119): install_run_tasks()
#19 /var/www/vendor/drush/drush/includes/drush.inc(213): install_drupal()
#20 /var/www/vendor/drush/drush/includes/drush.inc(197): drush_call_user_func_array()
#21 /var/www/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(149): drush_op()
#22 [internal function]: Drush\Commands\core\SiteInstallCommands->install()
#23 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#24 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#25 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#26 /var/www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#27 /var/www/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#28 /var/www/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run()
#29 /var/www/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#30 /var/www/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#31 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run()
#32 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun()
#33 /var/www/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#34 /var/www/vendor/drush/drush/drush(4): require('...')
#35 {main}.
Error: Attempt to modify property "col_content" on null in /var/www/web/modules/contrib/we_megamenu/src/WeMegaMenuBuilder.php on line 390 #0 /var/www/web/modules/contrib/we_megamenu/we_megamenu.module(700): Drupal\we_megamenu\WeMegaMenuBuilder::menuItemInsert()
#1 [internal function]: we_megamenu_entity_insert()
#2 /var/www/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(403): call_user_func_array()
#3 /var/www/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(251): Drupal\Core\Extension\ModuleHandler->invokeAll()
#4 /var/www/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(897): Drupal\Core\Entity\EntityStorageBase->invokeHook()
#5 /var/www/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(602): Drupal\Core\Entity\ContentEntityStorageBase->invokeHook()
#6 /var/www/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(782): Drupal\Core\Entity\EntityStorageBase->doPostSave()
#7 /var/www/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(527): Drupal\Core\Entity\ContentEntityStorageBase->doPostSave()
#8 /var/www/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php(802): Drupal\Core\Entity\EntityStorageBase->save()
#9 /var/www/web/core/lib/Drupal/Core/Entity/EntityBase.php(339): Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
#10 /var/www/web/profiles/contrib/droopler/modules/custom/d_content/modules/d_content_init/d_content_init.module(367): Drupal\Core\Entity\EntityBase->save()
#11 /var/www/web/profiles/contrib/droopler/modules/custom/d_content/modules/d_content_init/d_content_init.module(389): d_content_init_add_node()
#12 /var/www/web/profiles/contrib/droopler/modules/custom/d_content/modules/d_content_init/d_content_init.module(495): d_content_init_add_nodes()
#13 /var/www/web/profiles/contrib/droopler/modules/custom/d_content/modules/d_content_init/d_content_init.module(553): d_content_init_create_all()
#14 /var/www/web/core/includes/batch.inc(295): d_content_init_create_all_batch()
#15 /var/www/web/core/includes/form.inc(954): _batch_process()
#16 /var/www/web/core/includes/install.core.inc(653): batch_process()
#17 /var/www/web/core/includes/install.core.inc(571): install_run_task()
#18 /var/www/web/core/includes/install.core.inc(119): install_run_tasks()
#19 /var/www/vendor/drush/drush/includes/drush.inc(213): install_drupal()
#20 /var/www/vendor/drush/drush/includes/drush.inc(197): drush_call_user_func_array()
#21 /var/www/vendor/drush/drush/src/Commands/core/SiteInstallCommands.php(149): drush_op()
#22 [internal function]: Drush\Commands\core\SiteInstallCommands->install()
#23 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
#24 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#25 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#26 /var/www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#27 /var/www/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#28 /var/www/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run()
#29 /var/www/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#30 /var/www/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#31 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run()
#32 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun()
#33 /var/www/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#34 /var/www/vendor/drush/drush/drush(4): require('...')
#35 {main}
Error: Attempt to modify property "col_content" on null in Drupal\we_megamenu\WeMegaMenuBuilder::menuItemInsert() (line 390 of /var/www/web/modules/contrib/we_megamenu/src/WeMegaMenuBuilder.php).
[warning] Drush command terminated abnormally.
I am not getting this issue, maybe it is tied to some PHP version?
Nope - no luck. Basic error is the same - I still get Undefined array key "d_custom_init".
Built using PHP 8.1.3 - executed in Docker using PHP 8.0.15.
And there's no subtheme, by the way.
Hello,
I was finally able to install the theme and demo content. What I was trying to do from the beggining was to use an official docker image from drupal. However, the one you pull with no other arguments (latest) also has some of the latest dependencies. @grzegorz-pietrzak-droptica suggested that PHP might play a key role here so I went all the way back to the final release of droopler (July 2021) and found a docker image that was suitable (9.2.0). Indeed, using the dependencies required for drupal 9.2.16 was the solution for the above problem.
In the same (working) image I have the following dependencies:
- Composer 2.2.9
- PHP 7.4.28
- Apache 2.4.52
- NPM 8.5.0
- Node 16.14.2
Now one question remains - How compatible is the latest drupal release which has all the security fixes with php 7.4?
Also there are some other dependencies issues pointed by npm install. I will open a new issue later this week.
Thanks and good luck
Please have a look at https://www.drupal.org/docs/system-requirements/php-requirements
Generally, it is about error logging, which breaks AJAX output. If you turn off PHP notices for the time of installation, it will all work fine.
Please have a look at https://www.drupal.org/docs/system-requirements/php-requirements Generally, it is about error logging, which breaks AJAX output. If you turn off PHP notices for the time of installation, it will all work fine.
Not 100% this is the way to disable PHP notices: https://www.drupal.org/forum/support/post-installation/2008-09-15/how-to-disable-php-e_notice-errors-from-drupal
I tried disabling it the same way and the installation still breaks in the same fashion.
Later edit: I tried disabling it from php.ini too
Later edit 2: I also tried setting error_reporting = E_NONE;
in php.ini
Still no luck installing droopler with php 8.0. I managed to install Drupal 9.3.9 core alongside, but as the post above says - it's highly recommended to use supported php versions for maximum security
Hello, on Friday we released 3.1.0-rc1 version with we_megamenu
patched for full PHP 8.1 support.