Custom Webform handler not working on Wizard Webform I am attempting to write a simple webform handler to add to the end of a multi-step webform, ultimately to generate a barcode with the submitted data. I've had success with other handlers on single step forms but it looks like the handler causes the wizard form to freeze and not progress to the next step.
My suspicion is that I'm missing something in my plugin code but I can't seem to find an answer to the problem in similar issues.
So far there's no functionality attempted in the handler because the form freezes on the first step.
Ultimately I only need this handler to fire upon final submission of my form.
I'm trying to test for the forms state with $webform_submission-&gt;getState() but I can't seem to get it right
  public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) {
   
   $state = $webform_submission-&gt;getWebform()-&gt;getSetting('results_disabled') ? WebformSubmissionInterface::STATE_COMPLETED : $webform_submission-&gt;getState();
    if ($this-&gt;configuration['states'] &amp;&amp; in_array($state, $this-&gt;configuration['states'])) {
       //do something
      
    }
  }
Hopefully this will help someone out there but this is the code I finally got working.  It takes the serial value from a webform submission and writes a Png barcode for use in emails.  I'm using the Barcodes Module for Drupal 8.
use Com\Tecnick\Barcode\Barcode as BarcodeGenerator;

class BarcodeHandler extends WebformHandlerBase {
  /**
   * {@inheritdoc}
   * Write PNG barcode for registration emails
   */
 public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) {
   $regId = $webform_submission-&gt;serial();
   $type = 'C39';
   $barcode_file = 'registration/barcodes/' . $regId . '.png';
   $barcode = new BarcodeGenerator();
   $barcode_obj = $barcode-&gt;getBarcodeObj($type, $regId, 250, 50, 'black');

   file_put_contents($barcode_file, $barcode_obj-&gt;getPngData());
      
  }
}