Skip to content

Commit

Permalink
restrict CustomGroup.GetAfforms to block unless civicrm_admin_ui is e…
Browse files Browse the repository at this point in the history
…nabled
  • Loading branch information
ufundo committed Nov 20, 2024
1 parent 4d01d10 commit 80ed4e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ext/afform/core/Civi/Api4/Action/CustomGroup/GetAfforms.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ protected function doTask($item) {
->execute()
->column('name');

// we also needs this for
// restrict forms other than block to if Admin UI is enabled
$hasAdminUi = \CRM_Extension_System::singleton()->getMapper()->isActiveModule('civicrm_admin_ui');
if (!$hasAdminUi) {
$this->formTypes = array_intersect(['block'], $this->formTypes);
}

foreach ($this->formTypes as $type) {
switch ($type) {
Expand Down

0 comments on commit 80ed4e0

Please sign in to comment.