[php8-compat] Fix issue in APIv3 Where by because product has a column called options...
authorSeamus Lee <seamuslee001@gmail.com>
Fri, 4 Jun 2021 22:38:55 +0000 (22:38 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 4 Jun 2021 22:38:55 +0000 (22:38 +0000)
api/v3/Generic.php

index 586d34f5b98ecff1909ac5fdf9cf4a7867ebcac6..9a55547607365e1828914cfcd6a0fe62c38c9528 100644 (file)
@@ -511,7 +511,12 @@ function _civicrm_api3_generic_get_metadata_options(&$metadata, $apiRequest, $fi
     return;
   }
 
-  $fieldsToResolve = $apiRequest['params']['options']['get_options'];
+  if (!is_array($apiRequest['params']['options'])) {
+    $fieldsToResolve = [];
+  }
+  else {
+    $fieldsToResolve = $apiRequest['params']['options']['get_options'];
+  }
 
   if (!empty($metadata[$fieldname]['options']) || (!in_array($fieldname, $fieldsToResolve) && !in_array('all', $fieldsToResolve))) {
     return;