phacility/phabricator · error · Exception

Incorrect Property Passed

Error message

Incorrect Property Passed

What it means

PHUIHeaderView supports exactly one property type on the header itself: the integer constant PROPERTY_STATUS. addProperty($property, $value) stores values keyed by that type, and at render time a switch accepts only PHUIHeaderView::PROPERTY_STATUS — any other key (a string like 'due-date', an invented constant, or arguments shifted so a value lands in the type slot) hits the default case and throws. The supported entry point for status tags is setStatus($icon, $color, $name), which internally adds a PROPERTY_STATUS entry.

Source

Thrown at src/view/phui/PHUIHeaderView.php:362

      $left[] = phutil_tag(
        'div',
        array(
          'class' => 'phui-header-subheader',
        ),
        array(
          $this->subheader,
        ));
    }

    if ($this->properties || $this->policyObject || $this->tags) {
      $property_list = array();
      foreach ($this->properties as $type => $property) {
        switch ($type) {
          case self::PROPERTY_STATUS:
            $property_list[] = $property;
          break;
          default:
            throw new Exception(pht('Incorrect Property Passed'));
          break;
        }
      }

      if ($this->policyObject) {
        $property_list[] = $this->renderPolicyProperty($this->policyObject);
      }

      if ($this->tags) {
        $property_list[] = $this->tags;
      }

      $left[] = phutil_tag(
        'div',
        array(
          'class' => 'phui-header-subheader',
        ),
        $property_list);

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Use $header->setStatus($icon, $color, $name) for status tags.
  2. Or add the status entry directly: $header->addProperty(PHUIHeaderView::PROPERTY_STATUS, $tag).
  3. For arbitrary key/value data, use PHUIPropertyListView (via PHUIObjectBoxView), setSubheader(), setTags(), or setPolicyObject() instead of the header property slot.

Example fix

// before
$header->addProperty('due-date', $date_tag); // invalid type key: throws

// after
$header->setStatus('fa-clock-o', 'indigo', pht('Due Soon'));
// for arbitrary key/value data, use a property list:
$properties = id(new PHUIPropertyListView())
  ->addProperty(pht('Due Date'), $date_tag);
Defensive patterns

Strategy: type-guard

Validate before calling

$valid_types = array(PHUIHeaderView::PROPERTY_STATUS);
if (!in_array($type, $valid_types, true)) {
  // not a header property type: route the value to a PHUIPropertyListView
  $properties->addProperty($label, $value);
} else {
  $header->addProperty($type, $value);
}

Type guard

function isKnownHeaderPropertyType($type) {
  return $type === PHUIHeaderView::PROPERTY_STATUS;
}

Prevention

When it happens

Trigger: Calling $header->addProperty('some-key', $value) with a made-up key instead of PHUIHeaderView::PROPERTY_STATUS; or copying PHUIPropertyListView-style addProperty($key, $value) usage onto the header, where the first argument is a type enum rather than a label.

Common situations: Trying to display arbitrary metadata directly on a header; argument-order mistakes; code ported from property-list usage where keys are free-form strings.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/8538c8b2ef000b7b. Report an issue: GitHub.