projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f4b648
)
Afform.revert - Refuse to revert if there are no "where" constraints
author
Tim Otten
<totten@civicrm.org>
Sat, 9 Feb 2019 05:53:02 +0000
(
00:53
-0500)
committer
CiviCRM
<info@civicrm.org>
Wed, 16 Sep 2020 02:13:17 +0000
(19:13 -0700)
Bulk reverting everything would be... a bit... dangerous?
ext/afform/core/Civi/Api4/Action/Afform/Revert.php
patch
|
blob
|
blame
|
history
diff --git
a/ext/afform/core/Civi/Api4/Action/Afform/Revert.php
b/ext/afform/core/Civi/Api4/Action/Afform/Revert.php
index f194e6f1753803dbdc6ebdf7882ced8cb1c7ff77..377dd2683ace916870d05790db235059bd75a7e7 100644
(file)
--- a/
ext/afform/core/Civi/Api4/Action/Afform/Revert.php
+++ b/
ext/afform/core/Civi/Api4/Action/Afform/Revert.php
@@
-9,6
+9,10
@@
class Revert extends Get {
protected $select = ['name'];
public function _run(Result $result) {
+ if (empty($this->where)) {
+ throw new \API_Exception('Cannot revert with no "where" paramater specified');
+ }
+
$scanner = \Civi::service('afform_scanner');
parent::_run($result);