Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15445802
D14806.id35795.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14806.id35795.diff
View Options
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -1076,29 +1076,26 @@
final public function addActionToCrumbs(PHUICrumbsView $crumbs) {
$viewer = $this->getViewer();
- $can_create = $this->hasCreateCapability();
- if ($can_create) {
- $configs = $this->loadUsableConfigurationsForCreate();
- } else {
- $configs = array();
- }
+ $configs = $this->loadUsableConfigurationsForCreate();
$dropdown = null;
$disabled = false;
$workflow = false;
$menu_icon = 'fa-plus-square';
+ $can_create = $this->hasCreateCapability();
- if (!$configs) {
- if ($viewer->isLoggedIn()) {
- $disabled = true;
- } else {
- // If the viewer isn't logged in, assume they'll get hit with a login
- // dialog and are likely able to create objects after they log in.
- $disabled = false;
- }
+ // If the viewer isn't logged in, assume they'll get hit with a login
+ // dialog and are likely able to create objects after they log in.
+ if ($viewer->isLoggedIn()) {
+ $disabled = false;
$workflow = true;
+ } else {
+ $disabled = (!$can_create || !$configs);
+ $workflow = $disabled;
+ }
+ if (!$configs) {
if ($can_create) {
$create_uri = $this->getEditURI(null, 'nodefault/');
} else {
@@ -1110,11 +1107,11 @@
$create_uri = $this->getEditURI(null, "form/{$form_key}/");
if (count($configs) > 1) {
- $menu_icon = 'fa-caret-square-o-down';
-
$dropdown = id(new PhabricatorActionListView())
->setUser($viewer);
+ $menu_icon = 'fa-caret-square-o-down';
+
foreach ($configs as $config) {
$form_key = $config->getIdentifier();
$config_uri = $this->getEditURI(null, "form/{$form_key}/");
@@ -1125,8 +1122,14 @@
id(new PhabricatorActionView())
->setName($config->getDisplayName())
->setIcon($item_icon)
- ->setHref($config_uri));
+ ->setHref($config_uri)
+ ->setDisabled($disabled)
+ ->setWorkflow($workflow));
}
+
+ // If we made a dropdown menu, never put workflow on the action itself
+ // since we just want it to open the menu.
+ $workflow = false;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 28, 4:08 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225801
Default Alt Text
D14806.id35795.diff (2 KB)
Attached To
Mode
D14806: Improve handling of multiple edit forms when logged out
Attached
Detach File
Event Timeline
Log In to Comment