Skip to content
Snippets Groups Projects

Issue #2920039: Views' User Name exposed group filter validation

Closed Issue #2920039: Views' User Name exposed group filter validation
4 unresolved threads
4 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
95 95
96 96 if ($this->options['is_grouped'] && isset($this->options['group_info']['group_items'][$input])) {
97 97 $this->operator = $this->options['group_info']['group_items'][$input]['operator'];
98 $input = $this->options['group_info']['group_items'][$input]['value'];
98 $this->validated_exposed_input = $this->options['group_info']['group_items'][$input]['value'];
99 return;
99 100 }
100 101
101 102 $uids = [];
102 $values = $form_state->getValue($identifier);
103 if ($values && (!$this->options['is_grouped'] || ($this->options['is_grouped'] && ($input != 'All')))) {
104 foreach ($values as $value) {
103 if ($input && (!$this->options['is_grouped'] || ($this->options['is_grouped'] && ($input != 'All')))) {
  • 16 16 */
    17 17 class Name extends InOperator {
    18 18
    19 /**
    20 * Stores the exposed input for this filter.
    21 */
    22 public $validated_exposed_input;
  • 124 148 return parent::adminSummary();
    125 149 }
    126 150
    151 /**
    152 * {@inheritdoc}
    153 */
    154 public function buildExposedFiltersGroupForm(&$form, FormStateInterface $form_state) {
    155 // Rewrite the numeric values for textfields to entity labels for
    156 // autocomplete.
    157 foreach ($this->options['group_info']['group_items'] as $key => $item) {
    158 if (!empty($item['value'])) {
    159 $users = User::loadMultiple(($item['value']));
    160 $this->options['group_info']['group_items'][$key]['value'] = EntityAutocomplete::getEntityLabels($users);
  • 39 44 }
    40 45
    41 46 protected function valueValidate($form, FormStateInterface $form_state) {
    42 $uids = [];
    43 if ($values = $form_state->getValue(['options', 'value'])) {
    44 foreach ($values as $value) {
    45 $uids[] = $value['target_id'];
    47 // Autocomplete puts the values in target_id. Move the values to the
    48 // expected depth.
    49 // @todo Consider creating a trait/whatever to avoid duplicate code here
  • Ivan Doroshenko changed the description

    changed the description

  • Ivan Doroshenko changed target branch from 8.9.x to 9.4.x

    changed target branch from 8.9.x to 9.4.x

  • Please register or sign in to reply
    Loading