You are here

protected static function MediaForm::getUserInputValues in GridStack 8.2

Returns user input values.

3 calls to MediaForm::getUserInputValues()
MediaForm::getFieldState in src/Plugin/gridstack/stylizer/MediaForm.php
Gets the field state for the widget.
MediaForm::getNewMediaItems in src/Plugin/gridstack/stylizer/MediaForm.php
Gets newly selected media items.
MediaForm::mediaElement in src/Plugin/gridstack/stylizer/MediaForm.php
Returns Media Library form elements adapted from MediaLibraryWidget.

File

src/Plugin/gridstack/stylizer/MediaForm.php, line 617

Class

MediaForm
Provides the media form for Layout Builder integration.

Namespace

Drupal\gridstack\Plugin\gridstack\stylizer

Code

protected static function getUserInputValues(array $element, FormStateInterface $form_state) {

  // Default to using the current selection if the form is new.
  $path = isset($element['#parents']) ? $element['#parents'] : [];

  // We need to use the actual user input, since when #limit_validation_errors
  // is used, the unvalidated user input is not added to the form state.
  // @see FormValidator::handleErrorsWithLimitedValidation()
  return NestedArray::getValue($form_state
    ->getUserInput(), $path);
}