APIv4 - Consistently pass values into pseudoconstant callback
authorcolemanw <coleman@civicrm.org>
Mon, 24 Jul 2023 14:57:14 +0000 (10:57 -0400)
committercolemanw <coleman@civicrm.org>
Fri, 4 Aug 2023 12:10:22 +0000 (08:10 -0400)
Civi/Api4/Generic/BasicGetFieldsAction.php

index acf0f278545e70ee1a222cda48084b0c669dd2ec..4560013586d26c510e500955518facaaa442d0dc 100644 (file)
@@ -171,7 +171,7 @@ class BasicGetFieldsAction extends BasicGetAction {
         $field['options'] = self::pseudoconstantOptions($field['pseudoconstant']['optionGroupName']);
       }
       elseif (!empty($field['pseudoconstant']['callback'])) {
-        $field['options'] = call_user_func(\Civi\Core\Resolver::singleton()->get($field['pseudoconstant']['callback']), $field['name'], []);
+        $field['options'] = call_user_func(\Civi\Core\Resolver::singleton()->get($field['pseudoconstant']['callback']), $field['name'], ['values' => $this->getValues()]);
       }
       else {
         throw new \CRM_Core_Exception('Unsupported pseudoconstant type for field "' . $field['name'] . '"');