Useless block of code

Created on 17 February 2023, over 1 year ago

Problem/Motivation

Their is a piece of code that is apparently completly useless.

          // this first bloc
          if (in_array(SearchApiFilterTrait::class, class_uses($filter)) || $filter instanceof Bundle) {
            $field_id = $filter->options['field'];
          }
          else {
            $field_id = $filter->definition['field_name'];
          }

          if (in_array(SearchApiFilterTrait::class, class_uses($filter)) || $filter instanceof Bundle) {
            $field_id = $filter->options['field'];

            // For Search API fields find original property path:
            if (in_array(SearchApiFilterTrait::class, class_uses($filter))) {
              $index_fields = $view->getQuery()->getIndex()->getFields();
              if (isset($index_fields[$field_id])) {
                $field_id = $index_fields[$field_id]->getPropertyPath();
              }
            }
          }
          else {
            $field_id = $filter->definition['field_name'];
          }

Steps to reproduce

Proposed resolution

Remove it

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡«πŸ‡·France paul_leclerc Lausanne Switzerland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024