<?php

final class PhabricatorAuthMessagePHIDType extends PhabricatorPHIDType {

  const TYPECONST = 'AMSG';

  public function getTypeName() {
    return pht('Auth Message');
  }

  public function newObject() {
    return new PhabricatorAuthMessage();
  }

  public function getPHIDTypeApplicationClass() {
    return 'PhabricatorAuthApplication';
  }

  protected function buildQueryForObjects(
    PhabricatorObjectQuery $query,
    array $phids) {

    return id(new PhabricatorAuthMessageQuery())
      ->withPHIDs($phids);
  }

  public function loadHandles(
    PhabricatorHandleQuery $query,
    array $handles,
    array $objects) {
    return;
  }

}

<?php

final class PhabricatorAuthMessagePHIDType extends PhabricatorPHIDType {

  const TYPECONST = 'AMSG';

  public function getTypeName() {
    return pht('Auth Message');
  }

  public function newObject() {
    return new PhabricatorAuthMessage();
  }

  public function getPHIDTypeApplicationClass() {
    return 'PhabricatorAuthApplication';
  }

  protected function buildQueryForObjects(
    PhabricatorObjectQuery $query,
    array $phids) {

    return id(new PhabricatorAuthMessageQuery())
      ->withPHIDs($phids);
  }

  public function loadHandles(
    PhabricatorHandleQuery $query,
    array $handles,
    array $objects) {

    foreach ($handles as $phid => $handle) {
      $message = $objects[$phid];
      $handle->setURI($message->getURI());
    }
  }

}

Set a URI on Auth Messages, so the "Change Details" dialog from the transaction record has a cancel button
Set a URI on Auth Messages, so the "Change Details" dialog from the transaction record has a cancel button

Summary:
If you edit an auth message in Auth > Customize Messages, then click "Show Details" in the transaction record, the resulting dialog uses the object's handle's URI to generate a "cancel" button.

Since these handles currently have no URI, the dialog currently has no cancel/done button to close it.

Test Plan: Edited an auth message, clicked "Show Details", was now able to click "Done" to close the dialog.

Reviewers: amckinley

Reviewed By: amckinley

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