I have enabled simplenews module in drupal 8 and I am trying to reduce the width of input field from 60 to 30. I am trying to implement form alter hook and have devel module installed. I used dsm($form_id); to identify form and then in order to identify the form attribute to change, I tried to use dsm($form), dpm($form) and print_r($form) and all these are giving white screen of death.

function custom_newsletter_form_alter(&$form,  $form_state, $form_id) {  
  if ($form_id == 'simplenews_subscriptions_block_2138c21c-6453-4b7d-92d6-9407e427a78a') {

I have tried different drupal 8 installations both localhosted and web hosted, tried with different themes but I am not able to print form. Is there any other way to identify/target correct form attribute to change like DOM inspecter of firebug?

  • Welcome to Drupal Answers :) I made a small edit to your code to make it valid, if that's changed the meaning of your question at all please feel free to change it again
    – Clive
    May 11, 2016 at 16:04

2 Answers 2


It seems that dsm() and dpm() are not supported in Drupal 8. They are replaced by kint(). I have enabled the devel kint sub-module and used kint($form) to print my form array. You can also use ksm($form).


You can use \dpm($form) as per OOP because devel is in a different namespace.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.