- last update
over 1 year ago 2,146 pass - Status changed to Closed: won't fix
over 1 year ago 4:27pm 16 May 2023 - πΈπ°Slovakia poker10
Reading this again after a year, I prefer to close this as Won't fix, because of this reason (see #20):
A fatal error is the proper response here. There is no guarantee that the result of this function is going to be correct if the callback function does not exist. As a consequence, the consumers of this function might proceed and you will end up with inconsistent data.
If we commit this patch, we will change the expected output, because instead of custom callback, the default
taxonomy_allowed_values
function will be used even if the custom callback function is set:- $function = !empty($field['settings']['options_list_callback']) ? $field['settings']['options_list_callback'] : 'taxonomy_allowed_values'; + if (!empty($field['settings']['options_list_callback']) && function_exists($field['settings']['options_list_callback'])) { + $function = $field['settings']['options_list_callback']; + } + else { + $function = 'taxonomy_allowed_values'; + }
This is not ideal and it could lead to unexpected behavior. If anybody needs the patch, feel free to use it to prevent the error.
Thanks all for your effort here.