@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't make an expensive, unused call to test if a viewer can reassign a task

Summary: Depends on D19224. Ref T13106. Computing this is expensive and the value is not used. This came from D15432, but we never actually shipped that feature.

Test Plan: Saw local query cost drop from 139 to 110 with no change in functionality. Grepped for removed symbols.

Maniphest Tasks: T13106

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

-56
-3
src/applications/maniphest/controller/ManiphestTaskDetailController.php
··· 284 284 $edit_config = $edit_engine->loadDefaultEditConfiguration($task); 285 285 $can_create = (bool)$edit_config; 286 286 287 - $can_reassign = $edit_engine->hasEditAccessToTransaction( 288 - ManiphestTaskOwnerTransaction::TRANSACTIONTYPE); 289 - 290 287 if ($can_create) { 291 288 $form_key = $edit_config->getIdentifier(); 292 289 $edit_uri = id(new PhutilURI("/task/edit/form/{$form_key}/"))
-53
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 1398 1398 } 1399 1399 1400 1400 1401 - /** 1402 - * Test if the viewer could apply a certain type of change by using the 1403 - * normal "Edit" form. 1404 - * 1405 - * This method returns `true` if the user has access to an edit form and 1406 - * that edit form has a field which applied the specified transaction type, 1407 - * and that field is visible and editable for the user. 1408 - * 1409 - * For example, you can use it to test if a user is able to reassign tasks 1410 - * or not, prior to rendering dedicated UI for task reassignment. 1411 - * 1412 - * Note that this method does NOT test if the user can actually edit the 1413 - * current object, just if they have access to the related field. 1414 - * 1415 - * @param const Transaction type to test for. 1416 - * @return bool True if the user could "Edit" to apply the transaction type. 1417 - */ 1418 - final public function hasEditAccessToTransaction($xaction_type) { 1419 - $viewer = $this->getViewer(); 1420 - 1421 - $object = $this->getTargetObject(); 1422 - if (!$object) { 1423 - $object = $this->newEditableObject(); 1424 - } 1425 - 1426 - $config = $this->loadDefaultEditConfiguration($object); 1427 - if (!$config) { 1428 - return false; 1429 - } 1430 - 1431 - $fields = $this->buildEditFields($object); 1432 - 1433 - $field = null; 1434 - foreach ($fields as $form_field) { 1435 - $field_xaction_type = $form_field->getTransactionType(); 1436 - if ($field_xaction_type === $xaction_type) { 1437 - $field = $form_field; 1438 - break; 1439 - } 1440 - } 1441 - 1442 - if (!$field) { 1443 - return false; 1444 - } 1445 - 1446 - if (!$field->shouldReadValueFromSubmit()) { 1447 - return false; 1448 - } 1449 - 1450 - return true; 1451 - } 1452 - 1453 - 1454 1401 public function newNUXButton($text) { 1455 1402 $specs = $this->newCreateActionSpecifications(array()); 1456 1403 $head = head($specs);