Skip to main content

depency injection

Drupal Forms using ajax breaking dependency injection

Recently, I was building a custom Drupal form that used dependency injection and included an ajax submit handler. While testing the form, on the initial page load, the form submitted just fine using ajax. However, when the user used another ajax handler on the same form, all of the injected services were set to `NULL`.