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

[Bug]: Show in tree function does not work on second page if the last element of the first page has double quotes #284

Open
ascheider opened this issue Sep 20, 2023 · 2 comments
Assignees

Comments

@ascheider
Copy link
Contributor

Pimcore version

10.2 and 11

Steps to reproduce

1.) Create objects with the double quotes in one folder until second page is created
image
2.) Create some more elements on the second page
image
3.) Sort objects by key
4.) Open element on the second page, reload admin and try to click "Show in tree" inside the object. For example: Überschuhspender "Hygomat Classic"
5.) Pimcore loads the element of the first page and does not make any request for the second page, the element is not shown in the tree.
There is function getDirectionForElementsSortedByKey in file treenodelocator.js:

getDirectionForElementsSortedByKey: function (elementKey, elementType, firstElementChild, lastElementChild) {

The firstElementChild.data.text.toUpperCase() and lastElementChild.data.text.toUpperCase() returns " instead of double quotes, so the length check is wrong, so the method return 0 instead of 1 and request for the second page is not made anymore
image
If i decode the entity to double quotes the element is correct selected in the tree.
image
Maybe there is better way to replace entity without creating textarea.
Hope the description helps to reproduce the bug.
I also don't know if bug appear with other special characters in object key.
If you don't want to fix the bug in pimcore x, you can move the issue or create the new one in classic bundle repo: https://github.com/pimcore/admin-ui-classic-bundle/tree/1.x

Actual Behavior

I open the the object and click to show it in the tree, the object is not selected, because second page is not loaded

Expected Behavior

I open the the object and click to show it in the tree, the object is shown in the tree

@ascheider ascheider added the Bug label Sep 20, 2023
@dvesh3 dvesh3 transferred this issue from pimcore/pimcore Sep 20, 2023
@dvesh3
Copy link
Contributor

dvesh3 commented Sep 20, 2023

@ascheider thanks! I moved it to here to fix only for v11 since v10 reached EOL.

@robertSt7
Copy link
Contributor

@ascheider Sorry I am not able to reproduce the bug in pimcore 11. For me the double quotes are correct in the string. Could you please try it with the last version of the admin-ui-classic-bundle? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants