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]: pimcore_relations does not accept more than one folder after reload in the back-end. #17046

Closed
valik404 opened this issue May 14, 2024 · 9 comments · Fixed by #17054
Closed
Assignees
Labels
Milestone

Comments

@valik404
Copy link

Pimcore version

11.1.3

Steps to reproduce

Create a relation (doesn't matter if it's a editable dialog box or not). Drag in two folder's and save & publish. Now the relation will show objects of both folders. If you reload the page in the back-end, you will only see the last added folder in the relation. At this moment it will still show objects of both folders. Now if you save & publish again while there is only one folder in the relation, it will only display objects of the last added folder.

Actual Behavior

pimcore_relation only accepts one folder with objects.

Expected Behavior

Should accept more than one folder.

@valik404 valik404 added the Bug label May 14, 2024
@kingjia90
Copy link
Contributor

Can it be reproduced in the public demo? Any notable JS error in the Developer Tools' Console?
So far i wasn't able to exactly reproduce it, but i am on 11.2 and it could be already fixed somewhere else 🤔

@valik404
Copy link
Author

Hey, no there are no errors. I couldn't find any relations in the demo. Maybe it is already fixed with your version. I will check it. Thanks

@kingjia90
Copy link
Contributor

kingjia90 commented May 14, 2024

Mhh, i think i have misread the first time, you are using pimcore_relation which is many-to-one, therefore it HAS to be one, while you may want pimcore_relations (NB: plural) if you want to link multiple elements or folders.

So probably a visual/UI bug that somehow allows dropping more than one element on the many-to-one? I will double check that.

@valik404
Copy link
Author

My fault, I meant pimcore_relations. So it should accept more than one folder right?

@kingjia90
Copy link
Contributor

kingjia90 commented May 15, 2024

Ahh ok, all good. So far, it should be working as intended, I didn't find any problem in both editables types and there are no any recent changes from the JS side as well.

Maybe try to keep an eye on the Versions tab, to see if there's any change triggered by some custom implementation/third-party/autosave(?) to make sure whether it is losing data by not actually saving it or if it is "overwritten".

Looking forward to any further details and steps on how to reproduce it.

@valik404
Copy link
Author

Here is what I tryed:

{{ pimcore_areablock('content', {
'allowed': ['blockquote', 'embed', 'featurette', 'gallery-carousel', 'gallery-folder',
'gallery-single-images', 'headlines', 'horizontal-line', 'icon-teaser-row', 'image',
'image-hotspot-marker', 'image-metadata', 'pdf', 'product-grid', 'product-teaser', 'standard-teaser', 'text-accordion',
'time-slider-featurette', 'validity', 'video', 'wysiwyg', 'wysiwyg-with-images', 'personalized-product-teaser', 'teaser-news']
}) }}

  • "teaser-news" is my areabrick
    It's is still the same behavior. I got version 11.2.3 in this project now.

Before reload:
grafik

After reload:
grafik

Hope this helps to reproduce it.

@kingjia90
Copy link
Contributor

kingjia90 commented May 15, 2024

Ahh thank you for the detailed instruction, i am also confirming the issue as reproduce-able.
The fact that the subtype somehow becomes variant suggests that there might be a bug in there.
I will let you know when i find the cause

Update: by changing this line (removing the variant constant), it would work

$return[] = [$element->getId(), $element->getRealFullPath(), DataObject::OBJECT_TYPE_OBJECT, DataObject::OBJECT_TYPE_VARIANT, DataObject::OBJECT_TYPE_FOLDER];

Potential regression from #13233

@kingjia90
Copy link
Contributor

PR #17054 is ready, feel free to review it and give it a try

Thank you again for reporting!

@kingjia90 kingjia90 added this to the 11.2.4 milestone May 15, 2024
@kingjia90 kingjia90 self-assigned this May 15, 2024
@valik404
Copy link
Author

Yes, it actually works fine. Thank you very much for your fast help.
Have a good time.

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

Successfully merging a pull request may close this issue.

2 participants