1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-23 05:01:13 +01:00

Fix the incorrect link target for "Create Revision" as a Menu Item

Summary:
Depends on D20359. Fixes T12098. When you add a new "Form" item and pick "Create Revision", you currently get a bad link. This is because Differential is kind of special and the form isn't usable directly, even though Differential does use EditEngine.

Allow EditEngine to specify a different create URI, then specify the web UI paste-a-diff flow to fix this.

Test Plan:
  - Added "Create Revision" to a portal, clicked it, was sensibly put on the diff flow.
  - Grepped for `getCreateURI()`, the only other real use case is to render the "Create X" dropdowns in the upper right.
    - Clicked one of those, still worked great.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T12098

Differential Revision: https://secure.phabricator.com/D20360
This commit is contained in:
epriestley 2019-03-31 14:26:05 -07:00
parent dfe47157d3
commit c9d3fb2ac5
3 changed files with 17 additions and 8 deletions

View file

@ -63,6 +63,10 @@ final class DifferentialRevisionEditEngine
return $object->getMonogram();
}
public function getCreateURI($form_key) {
return '/differential/diff/create/';
}
protected function getObjectCreateShortText() {
return pht('Create Revision');
}

View file

@ -566,6 +566,18 @@ abstract class PhabricatorEditEngine
return $this->getObjectViewURI($object);
}
/**
* @task uri
*/
public function getCreateURI($form_key) {
try {
$create_uri = $this->getEditURI(null, "form/{$form_key}/");
} catch (Exception $ex) {
$create_uri = null;
}
return $create_uri;
}
/**
* @task uri

View file

@ -227,14 +227,7 @@ final class PhabricatorEditEngineConfiguration
public function getCreateURI() {
$form_key = $this->getIdentifier();
$engine = $this->getEngine();
try {
$create_uri = $engine->getEditURI(null, "form/{$form_key}/");
} catch (Exception $ex) {
$create_uri = null;
}
return $create_uri;
return $engine->getCreateURI($form_key);
}
public function getIdentifier() {