phacility/phabricator · error · Exception

Two different colors

Error message

Two different colors ("%s", "%s") are marked as the default color. Only one color may be marked as the default.

What it means

Fires in validateColorConfiguration when two entries are both marked 'default' => true. Exactly one default color is allowed, so the second default marking aborts validation; the conflicting keys are interpolated into the message.

Solutions

  1. Keep default => true on only one project.colors entry.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/project/icon/PhabricatorProjectIconSet.php:489 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/applications/project/icon/PhabricatorProjectIconSet.php:489

    $keys = array();
    foreach ($config as $idx => $value) {
      $key = $value['key'];
      if (isset($keys[$key])) {
        throw new Exception(
          pht(
            'Project colors must have unique keys, but two icons share the '.
            'same key ("%s").',
            $key));
      } else {
        $keys[$key] = true;
      }

      if (idx($value, 'default')) {
        if ($default === null) {
          $default = $value;
        } else {
          $original_key = $default['key'];
          throw new Exception(
            pht(
              'Two different colors ("%s", "%s") are marked as the default '.
              'color. Only one color may be marked as the default.',
              $key,
              $original_key));
        }
      }
    }

    if ($default === null) {
      throw new Exception(
        pht(
          'Project colors must include one color marked as the "%s" color, '.
          'but no such color exists.',
          'default'));
    }

  }

View on GitHub (pinned to 5720a38cfe)