Problem/Motivation

      if (!empty($form['#type']) && ($form['#type'] == 'checkboxes' || ($form['#type'] == 'select' && !empty($form['#multiple'])))) {
        unset($form[$value]['#default_value']);
      }

      if (!empty($form['#type']) && $form['#type'] == 'select' && empty($form['#multiple'])) {
        $form[$value]['#default_value'] = 'All';
      }

This is dead code as it looks at $form and not $form[$value], so it is never true. The logic really does happen in exposedTranslate()

Proposed resolution

Remove it.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#3 3019324-3.patch900 bytesvacho

Comments

Berdir created an issue. See original summary.

berdir’s picture

Issue tags: +Novice
vacho’s picture

StatusFileSize
new900 bytes

This patch solve this problem. I reviewed and @Berdir has reason and this code should be quited

andypost’s picture

Status: Active » Needs review
brathbone’s picture

Status: Needs review » Reviewed & tested by the community

I applied the patch in #3. The patch removes the requested code.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Yep !empty($form['#type'])<code> will never return TRUE because at this point $form is an array of form elements so it has no <code>#type key.

Committed 50d98d7 and pushed to 8.7.x. Thanks!

  • alexpott committed 50d98d7 on 8.7.x
    Issue #3019324 by vacho, Berdir: Dead code in FilterPluginBase::...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.