Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15387962
D11953.id28778.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
D11953.id28778.diff
View Options
diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php b/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
--- a/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
+++ b/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
@@ -130,6 +130,14 @@
$class));
}
+ if (!$engine->canUseInPanelContext()) {
+ throw new Exception(
+ pht(
+ 'Application search engines of class "%s" can not be used to build '.
+ 'dashboard panels.',
+ $class));
+ }
+
return $engine;
}
diff --git a/src/applications/phortune/query/PhortuneCartSearchEngine.php b/src/applications/phortune/query/PhortuneCartSearchEngine.php
--- a/src/applications/phortune/query/PhortuneCartSearchEngine.php
+++ b/src/applications/phortune/query/PhortuneCartSearchEngine.php
@@ -7,6 +7,11 @@
private $account;
private $subscription;
+ public function canUseInPanelContext() {
+ // These only make sense in an account or merchant context.
+ return false;
+ }
+
public function setAccount(PhortuneAccount $account) {
$this->account = $account;
return $this;
diff --git a/src/applications/phortune/query/PhortuneChargeSearchEngine.php b/src/applications/phortune/query/PhortuneChargeSearchEngine.php
--- a/src/applications/phortune/query/PhortuneChargeSearchEngine.php
+++ b/src/applications/phortune/query/PhortuneChargeSearchEngine.php
@@ -5,6 +5,11 @@
private $account;
+ public function canUseInPanelContext() {
+ // These only make sense in an account context.
+ return false;
+ }
+
public function setAccount(PhortuneAccount $account) {
$this->account = $account;
return $this;
diff --git a/src/applications/phortune/query/PhortuneSubscriptionSearchEngine.php b/src/applications/phortune/query/PhortuneSubscriptionSearchEngine.php
--- a/src/applications/phortune/query/PhortuneSubscriptionSearchEngine.php
+++ b/src/applications/phortune/query/PhortuneSubscriptionSearchEngine.php
@@ -6,6 +6,11 @@
private $merchant;
private $account;
+ public function canUseInPanelContext() {
+ // These only make sense in an account or merchant context.
+ return false;
+ }
+
public function setAccount(PhortuneAccount $account) {
$this->account = $account;
return $this;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 3:09 AM (1 w, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7671691
Default Alt Text
D11953.id28778.diff (2 KB)
Attached To
Mode
D11953: Forbid construction of dashboard panels on various Phortune objects
Attached
Detach File
Event Timeline
Log In to Comment