<?php

final class PhabricatorStandardCustomFieldHeader
  extends PhabricatorStandardCustomField {

  public function getFieldType() {
    return 'header';
  }

  public function renderEditControl(array $handles) {
    $header = phutil_tag(
      'div',
      array(
        'class' => 'phabricator-standard-custom-field-header',
      ),
      $this->getFieldName());
    return id(new AphrontFormStaticControl())
      ->setValue($header);
  }

  public function shouldUseStorage() {
    return false;
  }

  public function getStyleForPropertyView() {
    return 'header';
  }

  public function renderPropertyViewValue(array $handles) {
    return $this->getFieldName();
  }

  public function shouldAppearInApplicationSearch() {
    return false;
  }

}

<?php

final class PhabricatorStandardCustomFieldHeader
  extends PhabricatorStandardCustomField {

  public function getFieldType() {
    return 'header';
  }

  public function renderEditControl(array $handles) {
    $header = phutil_tag(
      'div',
      array(
        'class' => 'phabricator-standard-custom-field-header',
      ),
      $this->getFieldName());
    return id(new AphrontFormStaticControl())
      ->setValue($header);
  }

  public function shouldUseStorage() {
    return false;
  }

  public function getStyleForPropertyView() {
    return 'header';
  }

  public function renderPropertyViewValue(array $handles) {
    return $this->getFieldName();
  }

  public function shouldAppearInApplicationSearch() {
    return false;
  }

  public function shouldAppearInConduitTransactions() {
    return false;
  }

}

Stop "Header" fields (labels for form sections) from trying to generate Conduit edits
Stop "Header" fields (labels for form sections) from trying to generate Conduit edits

Summary: Fixes T12236. Headers are currently trying to generate an edit transaction for `maniphest.edit` and similar, but should not, since you can't edit them.

Test Plan:
  - Configured Maniphest with a custom header field.
  - Before change: `maniphest.edit` API console page fataled.
  - After change: all good, no weird "header" transaction.
  - Header still shows up on "Edit Task" form in web UI.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12236

Differential Revision: https://secure.phabricator.com/D17332
