You are here

public function Form::updateNode in Form Builder 7.2

File

modules/webform/src/Form.php, line 153

Class

Form

Namespace

Drupal\form_builder_webform

Code

public function updateNode($node) {
  $components = $this
    ->getComponents($node);
  $first = reset($components);
  if ($first['type'] == 'pagebreak') {
    $node->webform['progressbar_label_first'] = $first['name'];

    // Remove pagebreak if it has the right key.
    if (substr($first['form_key'], 0, strlen(self::LABEL_PREFIX)) === self::LABEL_PREFIX) {
      unset($components[$first['cid']]);
      foreach ($components as &$c) {
        $c['page_num']--;
      }
    }
  }
  $node->webform['components'] = $components;
}