Backend

Custom validation on a views field plugin options form

Submitted by charles on

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 {