Custom validation on a views field plugin options form

Submitted by charles on Tue, 11/14/2023 - 12:47

When validating an options form for a views field plugin class that extends FieldPluginBase, you need to add a `validateOptionsForm()` function and use an array for getting the value although when setting the error you don't need to include 'options':

 * {@inheritdoc}
public function validateOptionsForm(&$form, FormStateInterface $form_state): void {