{"record":{"id":"8538c8b2ef000b7b","repo":"phacility/phabricator","slug":"incorrect-property-passed","errorCode":null,"errorMessage":"Incorrect Property Passed","messagePattern":"Incorrect Property Passed","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/view/phui/PHUIHeaderView.php","lineNumber":362,"sourceCode":"      $left[] = phutil_tag(\n        'div',\n        array(\n          'class' => 'phui-header-subheader',\n        ),\n        array(\n          $this->subheader,\n        ));\n    }\n\n    if ($this->properties || $this->policyObject || $this->tags) {\n      $property_list = array();\n      foreach ($this->properties as $type => $property) {\n        switch ($type) {\n          case self::PROPERTY_STATUS:\n            $property_list[] = $property;\n          break;\n          default:\n            throw new Exception(pht('Incorrect Property Passed'));\n          break;\n        }\n      }\n\n      if ($this->policyObject) {\n        $property_list[] = $this->renderPolicyProperty($this->policyObject);\n      }\n\n      if ($this->tags) {\n        $property_list[] = $this->tags;\n      }\n\n      $left[] = phutil_tag(\n        'div',\n        array(\n          'class' => 'phui-header-subheader',\n        ),\n        $property_list);","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/view/phui/PHUIHeaderView.php#L344-L380","documentation":"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.","triggerScenarios":"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.","commonSituations":"Trying to display arbitrary metadata directly on a header; argument-order mistakes; code ported from property-list usage where keys are free-form strings.","solutions":["Use $header->setStatus($icon, $color, $name) for status tags.","Or add the status entry directly: $header->addProperty(PHUIHeaderView::PROPERTY_STATUS, $tag).","For arbitrary key/value data, use PHUIPropertyListView (via PHUIObjectBoxView), setSubheader(), setTags(), or setPolicyObject() instead of the header property slot."],"exampleFix":"// before\n$header->addProperty('due-date', $date_tag); // invalid type key: throws\n\n// after\n$header->setStatus('fa-clock-o', 'indigo', pht('Due Soon'));\n// for arbitrary key/value data, use a property list:\n$properties = id(new PHUIPropertyListView())\n  ->addProperty(pht('Due Date'), $date_tag);","handlingStrategy":"type-guard","validationCode":"$valid_types = array(PHUIHeaderView::PROPERTY_STATUS);\nif (!in_array($type, $valid_types, true)) {\n  // not a header property type: route the value to a PHUIPropertyListView\n  $properties->addProperty($label, $value);\n} else {\n  $header->addProperty($type, $value);\n}","typeGuard":"function isKnownHeaderPropertyType($type) {\n  return $type === PHUIHeaderView::PROPERTY_STATUS;\n}","tryCatchPattern":null,"preventionTips":["Treat addProperty() on headers as internal: prefer setStatus() for status tags.","The first argument is a type enum, not a display label.","Arbitrary key/value data belongs in PHUIPropertyListView, not on the header."],"tags":["php","phabricator","header-view","property","enum"],"backgroundTag":"invalid-property-type","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}