- Issue created by @amal.bukhari
- 🇩🇪Germany jurgenhaas Gottmadingen
Can you please provide the full stacktrace from the error log? A submit handler by definition always gets called with the form array as the first argument, so it's surprising that something is calling it with a NULL value.
- 🇲🇾Malaysia amal.bukhari
Hi Jurgen,
Below is the stacktrace:
The website encountered an unexpected error. Try again later.
TypeError: Drupal\eca_form\HookHandler::submit(): Argument #1 ($form) must be of type array, null given in Drupal\eca_form\HookHandler::submit() (line 146 of modules/contrib/eca/modules/form/src/HookHandler.php).
call_user_func_array(Array, Array) (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(NULL, Object) (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm(NULL, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('user_login_form', NULL, Object) (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 68)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19) - 🇲🇾Malaysia amal.bukhari
Additional information on steps to reproduce:
- > drush sql:drop
- Installed Drupal via browser using minimal profile.
- > drush thin gin; drush in symfony_mailer mailer_transport; drush in acl actions_permissions address admin_toolbar admin_toolbar_search admin_toolbar_tools advanced_cors advancedqueue antibot auto_entitylabel autologout automated_cron better_exposed_filters big_pipe block_content bpmn_io breakpoint captcha charts charts_chartjs charts_highcharts ckeditor5 ckeditor5_plugin_pack ckeditor5_plugin_pack_auto_image ckeditor5_plugin_pack_bookmark ckeditor5_plugin_pack_emoji ckeditor5_plugin_pack_find_and_replace ckeditor5_plugin_pack_font ckeditor5_plugin_pack_highlight ckeditor5_plugin_pack_indent_block ckeditor5_plugin_pack_link_attributes ckeditor5_plugin_pack_page_break ckeditor5_plugin_pack_paste_markdown ckeditor5_plugin_pack_select_all ckeditor5_plugin_pack_text_transformation ckeditor5_plugin_pack_todo_document_list ckeditor5_plugin_pack_word_count coffee colorbox colorbox_inline colorbox_load config config_update config_update_ui consumers content_access content_moderation contextual csv_serialization custom_field custom_field_linkit custom_field_media custom_field_viewfield datetime datetime_range devel devel_generate diff download_all_files dynamic_entity_reference easy_breadcrumb easy_email easy_email_override eca eca_access eca_base eca_cache eca_config eca_content eca_development eca_endpoint eca_entity_print eca_file eca_log eca_misc eca_modeller_bpmn eca_parameters eca_parameters_ui eca_queue eca_render eca_site_building eca_tamper eca_ui eca_user eca_vbo eca_views eca_views_data_export eca_workflow editablefields editor email_registration email_tfa entity entity_block entity_browser entity_browser_enhanced entity_browser_entity_form entity_print entity_print_views entity_reference_revisions epp erd feeds feeds_ex feeds_log feeds_tamper fences fences_presets field_group field_layout field_permissions field_ui file filefield_paths filehash fpa geocoder geolocation gin_login gin_toolbar gin_toolbar_custom_menu helper history honeypot http_response_headers iconify_icons iframe image image_captcha inline_entity_form inline_form_errors jquery_ui jquery_ui_accordion jquery_ui_autocomplete jquery_ui_datepicker jquery_ui_draggable jquery_ui_droppable jquery_ui_menu jquery_ui_resizable jquery_ui_slider jquery_ui_touch_punch js_cookie jsonapi jsonapi_defaults jsonapi_extras key key_auth layout_builder layout_discovery link linkit login_history maxlength media media_library menu_link_content menu_ui modal_page monolog multiple_fields_remove_button ng_lightbox openapi openapi_jsonapi openapi_rest openapi_ui openapi_ui_redoc options pager_serializer parameters parameters_ui password_policy password_policy_blacklist password_policy_character_types password_policy_characters password_policy_consecutive password_policy_delay password_policy_history password_policy_length password_policy_username path pathauto persistent_login profile queue_order queue_ui recaptcha_v3 redirect redirect_404 redirect_domain remove_http_headers responsive_image rest rest_views rest_views_geo rest_views_revisions rest_views_search_api restui s3fs s3fs_cors schemata schemata_json_schema search_api seckit security_review serialization session_inspector session_inspector_browserdetector session_inspector_hostname_geocoder session_limit settings_tray simple_oauth sitewide_alert sitewide_alert_block smart_date smart_date_recur smart_trim subpathauto subrequests symfony_mailer_log symfony_mailer_queue tac_lite tac_lite_create tagify tagify_iconify_icons tagify_user_list tamper taxonomy taxonomy_machine_name taxonomy_manager telephone token token_eca_alter token_filter toolbar trash twig_tweak ultimate_cron user_registrationpassword view_custom_table view_password views views_aggregator views_aggregator_more_functions views_argument_token views_bulk_edit views_bulk_operations views_conditional views_data_export views_extras views_ui visitors visitors_geoip workflows xmlsitemap xmlsitemap_custom xmlsitemap_engines;
- Activated Gin theme and set as default.
- Logged out.
- Logged in, and got WSOD with the error.
- Reloaded page and page worked fine.
Interestingly however, the following reproduction didn't produce the error
- > drush sql:drop
- Installed Drupal via browser using minimal profile.
- > drush thin gin; drush in eca_form eca_helper simple_oauth remove_http_headers;
- Activated Gin theme and set as default.
- Logged out.
- Logged in.
- Reloaded page and page worked fine.
- 🇩🇪Germany jurgenhaas Gottmadingen
Wow, that's a lot of modules. One of them is most likely not playing nice with the form API.
So find out which one, you would have to use xdebug or something similar to set a breakpoint in
Drupal\eca_form\HookHandler::submit()
and then go back in the stacktrace toDrupal\Core\Form\FormSubmitter->executeSubmitHandlers
and see which submit handler is calling this with a NULL value instead of the form array. - 🇲🇾Malaysia amal.bukhari
Found it! It's from the module email_tfa.
Please advise on the next steps.
- 🇩🇪Germany jurgenhaas Gottmadingen
Looks like the maintainer of email_tfa doesn't want to look into this. You need to use xdebug to set a break point in line 146 of
modules/contrib/eca/modules/form/src/HookHandler.php
and then go back in the stack trace to find out why the first argument is provided as NULL instead of an array.If you can't do that xdebug exercise yourself, you should provide exact steps on how to reproduce this on a vanilla Drupal 11 installation, so that somebody else can reproduce this and then try to find the source of the issue.