Make the Views Entity Form Field sortable

Created on 25 March 2024, 8 months ago
Updated 10 April 2024, 7 months ago

Problem/Motivation

Currently the Views Entity Form Field does has sorting disabled, although unlike other pseudo fields it is based on real fields which are stored in the database. With the information from the entity field the form field is representing the view can be easily be sorted if the correct statements about field aliases, join statements for relationships and order by clauses are added to the views query.

Steps to reproduce

The Views Entity Form Field can not be selected for sorting (default or click sorting) in the format settings of the view.

Proposed resolution

As the Views Entity Form Field is based on entity fields, which are stored in the database, sorting can be enabled and be based on the settings of the underlying entity field. If the field does not use a view relationship, it has to be added to the field aliases in the view query. If it uses a view relationship, a corresponding "join" statement should be added to the view query. To enable the sorting, an "order by" clause is added to the view query.

Remaining tasks

Provide a patch.

User interface changes

The Views Entity Form Fields can be selected as sortable in the view settings.

API changes

None

Data model changes

None

Feature request
Status

Needs review

Component

Code

Created by

🇦🇹Austria jordik

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

Comments & Activities

Production build 0.71.5 2024