Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Select filter in custom entities lost after a page reload #8346

@tstauer

Description

@tstauer
Q A
Sulu Version 2.6.12
PHP Version 8.3.27
DB Version MySQL 8.4.7
Browser Version Firefox 140.5.0esr (aarch64)

Actual Behavior

After selecting a filter on a custom entity list, it initially works as expected. However, after reloading the page or navigating away and returning to the list, the previously selected filter value is no longer shown in the dropdown. This makes it possible to apply the same filter multiple times.

Expected Behavior

The select filter in custom entities should work like with articles - there the values are remembered.

Steps to Reproduce

Add a select to the list of your custom entity.

<property name="approval" visibility="always" searchability="yes" translation="app.review.approval">
    <field-name>approval</field-name>
    <entity-name>App\Entity\Review</entity-name>
    <transformer type="translation">
        <params>
            <param name="prefix" value="app.review.approval."/>
        </params>
    </transformer>
    <filter type="select">
        <params>
            <param name="options" type="collection">
                <param name="1" value="app.review.approval.1" />
                <param name="2" value="app.review.approval.2" />
                <param name="3" value="app.review.approval.3" />
            </param>
        </params>
    </filter>
</property>

Use the browser to test.

  1. The select is empty initially
Image
  1. I clicked on some checkboxes
Image
  1. I applied the filter by clicking ok
Image
  1. I reloaded the page and take a peek at the selected options
Image
  1. I check some checkboxes
Image
  1. I see the label now contains the old and the new choices
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugError or unexpected behavior of already existing functionality

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions