Pass the Form & Field instances to the static method used to generate field options

Brings code into line with documentation here: 1015a56294
This commit is contained in:
Luke Towers 2020-12-11 15:33:43 -06:00 committed by GitHub
parent 0718d04a7f
commit 2d6b35b31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1333,7 +1333,7 @@ class Form extends WidgetBase
if (str_contains($fieldOptions, '::')) {
$options = explode('::', $fieldOptions);
if (count($options) === 2 && class_exists($options[0]) && method_exists($options[0], $options[1])) {
$result = $options[0]::{$options[1]}();
$result = $options[0]::{$options[1]}($this, $field);
if (!is_array($result)) {
throw new ApplicationException(Lang::get('backend::lang.field.options_static_method_invalid_value', [
'class' => $options[0],