Skip to content
Snippets Groups Projects
Commit 44a0badb authored by Nels's avatar Nels Committed by szato
Browse files

Issue #3337096: Settings form Validation error,...

Issue #3337096: Settings form Validation error, Drupal\filefield_sources_jsonapi\Plugin\FilefieldSource\RemoteJSONAPI::jsoanApiSourceValidateRequired() cannot be called statically
parent 05d0f849
No related branches found
No related tags found
1 merge request!5Issue #3337096: Settings form Validation error, Drupal\filefield_sources_jsonapi\Plugin\FilefieldSource\RemoteJSONAPI::jsoanApiSourceValidateRequired() cannot be called statically
......@@ -462,7 +462,7 @@ class RemoteJSONAPI extends Remote {
'#title' => t('JSON API settings'),
'#description' => t('Defined JSON API settings at <a href=":url">manage JSON API sources</a> page.', [':url' => Url::fromRoute('entity.filefield_sources_jsonapi.collection')->toString()]),
'#default_value' => $settings['source_remote_jsonapi']['sources'] ?: NULL,
'#element_validate' => [[get_called_class(), 'jsoanApiSourceValidateRequired']],
'#element_validate' => [[get_called_class(), 'jsonApiSourceValidateRequired']],
];
$return['source_remote_jsonapi']['image_style'] = [
'#type' => 'select',
......@@ -485,7 +485,7 @@ class RemoteJSONAPI extends Remote {
/**
* Custom validation for JSON API source.
*/
public function jsoanApiSourceValidateRequired($element, FormStateInterface $form_state) {
public static function jsonApiSourceValidateRequired($element, FormStateInterface $form_state) {
// Go 2 levels up.
$parents = array_slice($element['#parents'], 0, count($element['#parents']) - 2, TRUE);
$input = NestedArray::getValue($form_state->getValues(), $parents);
......
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