Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering Tags by Changer and/or Creator returns no results #7258

Open
Mirogniewa opened this issue Jan 30, 2024 · 1 comment
Open

Filtering Tags by Changer and/or Creator returns no results #7258

Mirogniewa opened this issue Jan 30, 2024 · 1 comment
Labels
Bug Error or unexpected behavior of already existing functionality

Comments

@Mirogniewa
Copy link

Q A
Sulu Version 2.5.10
PHP Version 8.2.15
DB Version 10.3.39-MariaDB-0ubuntu0.20.04.2
Browser Version Google Chrome 120.0.6099.224 64-bit

Actual Behavior

Filtering Tags by Changer always results in empty list.

Expected Behavior

Tags list should contain all tags which have their Changer value equal to one of the values selected in Changer filter.

Steps to Reproduce

  1. Log into admin.
  2. Go to Settings ->Tags.
  3. Click "Add" at the top of the page.
  4. Enter the name of your new tag and save it.
  5. Click the filter icon above the tags list and choose "Changer".
  6. When presented with input, start typing your admin user name to see a list of admin users.
  7. Choose your account from the list.
  8. Click Ok.

Repeat the steps for Creator instead of Changer - actual behavior and expected behavior show the same problem.

@Mirogniewa Mirogniewa added the Bug Error or unexpected behavior of already existing functionality label Jan 30, 2024
@rhp-zellerd
Copy link

rhp-zellerd commented Jan 31, 2024

This most likely comes from the fact, that the url is like this filter.creator%5B0%5D=1 and features the id of the creator and not the name. If you exchange the id with the name it works. Working url: filter.creator%5B0%5D=Adam+Ministrator
This seems to happen with all joined fields. For the contact bundle however this works, because Sulu has a hidden id field in the properties. Adding a hidden creater/updater ID like in the contact bundle should fix this.

This is how it's done in the contact bundle:

    <property
        name="tagId"
        visibility="never"
        translation="sulu_tag.tags"
    >
        <field-name>id</field-name>
        <entity-name>SuluTagBundle:Tag</entity-name>

        <joins ref="tags"/>

        <filter type="selection">
            <params>
                <param name="displayProperty" value="name" />
                <param name="resourceKey" value="tags" />
            </params>
        </filter>
    </property>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error or unexpected behavior of already existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants