Skip to content
Snippets Groups Projects
Commit cd72683b authored by Seamus Lee's avatar Seamus Lee
Browse files

[php8-compat] Fix issue in APIv3 Where by because product has a column called...

[php8-compat] Fix issue in APIv3 Where by because product has a column called options the testCreateSingleValueAlter triggers a cannot access offset of type string on string in php8
parent c1f3628f
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment