1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Stop threading handles through the CustomField + ApplicationSearch pipeline

Summary:
Ref T8441. Ref T7715.

  - These are obsolete after the Viewer/HandlePool changes.
  - These are unused after the typeahead parameterization changes.

Test Plan: `grep`, poked around.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7715, T8441

Differential Revision: https://secure.phabricator.com/D13176
This commit is contained in:
epriestley 2015-06-07 07:32:46 -07:00
parent cdef3e8bc8
commit ecc4c531c9
11 changed files with 12 additions and 68 deletions

View file

@ -1111,30 +1111,10 @@ abstract class PhabricatorApplicationSearchEngine extends Phobject {
return; return;
} }
$phids = array();
foreach ($list->getFields() as $field) { foreach ($list->getFields() as $field) {
$key = $this->getKeyForCustomField($field); $key = $this->getKeyForCustomField($field);
$value = $saved->getParameter($key); $value = $saved->getParameter($key);
$phids[$key] = $field->getRequiredHandlePHIDsForApplicationSearch($value); $field->appendToApplicationSearchForm($this, $form, $value);
}
$all_phids = array_mergev($phids);
$handles = array();
if ($all_phids) {
$handles = id(new PhabricatorHandleQuery())
->setViewer($this->requireViewer())
->withPHIDs($all_phids)
->execute();
}
foreach ($list->getFields() as $field) {
$key = $this->getKeyForCustomField($field);
$value = $saved->getParameter($key);
$field->appendToApplicationSearchForm(
$this,
$form,
$value,
array_select_keys($handles, $phids[$key]));
} }
} }

View file

@ -768,49 +768,28 @@ abstract class PhabricatorCustomField {
/** /**
* Append search controls to the interface. If you need handles, use * Append search controls to the interface.
* @{method:getRequiredHandlePHIDsForApplicationSearch} to get them.
* *
* @param PhabricatorApplicationSearchEngine Engine constructing the form. * @param PhabricatorApplicationSearchEngine Engine constructing the form.
* @param AphrontFormView The form to update. * @param AphrontFormView The form to update.
* @param wild Value from the saved query. * @param wild Value from the saved query.
* @param list<PhabricatorObjectHandle> List of handles.
* @return void * @return void
* @task appsearch * @task appsearch
*/ */
public function appendToApplicationSearchForm( public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine, PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form, AphrontFormView $form,
$value, $value) {
array $handles) {
if ($this->proxy) { if ($this->proxy) {
return $this->proxy->appendToApplicationSearchForm( return $this->proxy->appendToApplicationSearchForm(
$engine, $engine,
$form, $form,
$value, $value);
$handles);
} }
throw new PhabricatorCustomFieldImplementationIncompleteException($this); throw new PhabricatorCustomFieldImplementationIncompleteException($this);
} }
/**
* Return a list of PHIDs which @{method:appendToApplicationSearchForm} needs
* handles for. This is primarily useful if the field stores PHIDs and you
* need to (for example) render a tokenizer control.
*
* @param wild Value from the saved query.
* @return list<phid> List of PHIDs.
* @task appsearch
*/
public function getRequiredHandlePHIDsForApplicationSearch($value) {
if ($this->proxy) {
return $this->proxy->getRequiredHandlePHIDsForApplicationSearch($value);
}
return array();
}
/* -( ApplicationTransactions )-------------------------------------------- */ /* -( ApplicationTransactions )-------------------------------------------- */

View file

@ -282,8 +282,7 @@ abstract class PhabricatorStandardCustomField
public function appendToApplicationSearchForm( public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine, PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form, AphrontFormView $form,
$value, $value) {
array $handles) {
return; return;
} }

View file

@ -65,8 +65,7 @@ final class PhabricatorStandardCustomFieldBool
public function appendToApplicationSearchForm( public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine, PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form, AphrontFormView $form,
$value, $value) {
array $handles) {
$form->appendChild( $form->appendChild(
id(new AphrontFormSelectControl()) id(new AphrontFormSelectControl())

View file

@ -133,8 +133,7 @@ final class PhabricatorStandardCustomFieldDate
public function appendToApplicationSearchForm( public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine, PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form, AphrontFormView $form,
$value, $value) {
array $handles) {
if (!is_array($value)) { if (!is_array($value)) {
$value = array(); $value = array();

View file

@ -62,8 +62,7 @@ final class PhabricatorStandardCustomFieldInt
public function appendToApplicationSearchForm( public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine, PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form, AphrontFormView $form,
$value, $value) {
array $handles) {
$form->appendChild( $form->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())

View file

@ -57,8 +57,7 @@ final class PhabricatorStandardCustomFieldLink
public function appendToApplicationSearchForm( public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine, PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form, AphrontFormView $form,
$value, $value) {
array $handles) {
$form->appendChild( $form->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())

View file

@ -61,13 +61,6 @@ abstract class PhabricatorStandardCustomFieldPHIDs
} }
} }
public function getRequiredHandlePHIDsForApplicationSearch($value) {
if ($value) {
return $value;
}
return array();
}
public function getRequiredHandlePHIDsForPropertyView() { public function getRequiredHandlePHIDsForPropertyView() {
$value = $this->getFieldValue(); $value = $this->getFieldValue();
if ($value) { if ($value) {

View file

@ -38,8 +38,7 @@ final class PhabricatorStandardCustomFieldSelect
public function appendToApplicationSearchForm( public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine, PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form, AphrontFormView $form,
$value, $value) {
array $handles) {
if (!is_array($value)) { if (!is_array($value)) {
$value = array(); $value = array();

View file

@ -40,8 +40,7 @@ final class PhabricatorStandardCustomFieldText
public function appendToApplicationSearchForm( public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine, PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form, AphrontFormView $form,
$value, $value) {
array $handles) {
$form->appendChild( $form->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())

View file

@ -29,8 +29,7 @@ final class PhabricatorStandardCustomFieldUsers
public function appendToApplicationSearchForm( public function appendToApplicationSearchForm(
PhabricatorApplicationSearchEngine $engine, PhabricatorApplicationSearchEngine $engine,
AphrontFormView $form, AphrontFormView $form,
$value, $value) {
array $handles) {
$control = id(new AphrontFormTokenizerControl()) $control = id(new AphrontFormTokenizerControl())
->setLabel($this->getFieldName()) ->setLabel($this->getFieldName())