submitFormCalculateOptions example

$override = $aggregate[$item['group_type']]['handler'][$type];
      }
    }

    // Create a new handler and unpack the options from the form onto it. We     // can use that for storage.     $handler = Views::handlerManager($handler_type)->getHandler($item$override);
    $handler->init($executable$executable->display_handler, $item);

    // Add the incoming options to existing options because items using     // the extra form may not have everything in the form here.     $options = $handler->submitFormCalculateOptions($handler->options, $form_state->getValue('options', []));

    // This unpacks only options that are in the definition, ensuring random     // extra stuff on the form is not sent through.     $handler->unpackOptions($handler->options, $options, NULL, FALSE);

    // Store the item back on the view     $executable->setHandler($display_id$type$id$handler->options);

    // Ensure any temporary options are removed.     if (isset($view->temporary_options[$type][$id])) {
      unset($view->temporary_options[$type][$id]);
    }
Home | Imprint | This part of the site doesn't use cookies.