Page MenuHomePhabricator

HeraldAdapter throws exception on empty user custom field.
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Create custom filed (Maniphest) with type user
  2. Create herald rule (Maniphest task) on this filed with "include any of"
  3. Try to create task
Argument 1 passed to array_fuse() must be of the type array, null given, called in /phabricator/src/applications/herald/adapter/HeraldAdapter.php on line 382 and defined

I think this also "works" with other PHID based fields and other applications.

Simplest resolution is to overide method getFieldVlaue in PhabricatorStandardCustomFieldPHIDS to return array if parent return null.

public function getFieldValue()                                                                                                                      
{                                                                                                                                                    
  $value = parent::getFieldValue();                                                                                                                
  if ($value) {                                                                                                                                    
    return $value;                                                                                                                               
  }                                                                                                                                                

  return array();                                                                                                                                  
}