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

Datasource-grouping only works for first associated section #86

Open
twiro opened this issue Aug 17, 2017 · 4 comments
Open

Datasource-grouping only works for first associated section #86

twiro opened this issue Aug 17, 2017 · 4 comments
Assignees

Comments

@twiro
Copy link

twiro commented Aug 17, 2017

I have the following scenario:

  • One "Images"-section is used to manage all images of two other sections "Projects" and "News".
  • The entries in the "Images"-section are associated to a single entry of on of these two "parent"-sections. I use a (hidden) SBL-field called "entry" for that.
  • I have a datasource called "images" that pulls all the images for the currently needed entries.
  • On specific fronted pages I have to show images for multiple entries, so I want to group the entries in the "images"-datasource by their parent-entry.

This results in the following buggy behavior:

  • The image-entries associated to entries of the first parent-section "Projects" show up as expected in the datasource (grouped by parent-entry).
  • The image-entries associated to entries of the second parent-section "News" simply disappear.

As soon as I turn off grouping all expected image-entries (of both parent-sections) are included in the datasource again. I also tried switching to a more fancy name than "entry" for the SBL-field - doesn't do a difference. I also tested this scenario with Association Field - obviously has the same bug.

Setup:

  • Symphony 2.6.11
  • Selectbox Link Field 2.0.0
  • Association Field 2.0.1
@nitriques
Copy link
Member

Hum that's weird.
Do you have the same problem with Symphony 2.7.0 ?

@twiro
Copy link
Author

twiro commented Aug 17, 2017

Do you have the same problem with Symphony 2.7.0 ?

Yep. Just replicated the exact same issue with the following Setup:

  • Symphony 2.7.0
  • Selectbox Link Field 2.0.1
  • Association Field 2.0.2

@twiro
Copy link
Author

twiro commented Aug 17, 2017

A few screenshots to illustrate my test-setting:

Section "Projects"

screen shot 2017-08-17 at 22 09 07

Section "News"

screen shot 2017-08-17 at 22 09 19

Section "Images"

screen shot 2017-08-17 at 22 05 39

Section "Images" - "Parent Entry" Selectbox Link Field

screen shot 2017-08-17 at 22 10 31

Frontend Test Case

Now I build a datasource "projects" including all 4 entries from the "projects"-section, another datasource named "news" including all 4 entries from the "news"-section and a third datasource named "images" that is filtered by the ds-params of the first two datasources. The filter-settings look like this:

screen shot 2017-08-17 at 22 06 16

If a don't activate grouping the output of the datasource "images" looks like this:

screen shot 2017-08-17 at 22 12 20

If i activate grouping by "parent entry" the output changes to this:

screen shot 2017-08-17 at 22 11 58

So obviously datasource-grouping by entries of a SBL- or association-field doesn't work as expected if the SBL- or association-field contains entries from multiple sections.

@nitriques
Copy link
Member

Doesn't work as expected if the SBL- or association-field contains entries from multiple sections.

The problem I see are missing records, but the order seems correct (A is before C). I am right ?

Also, what happens if you change the order direction (meaning it should find a News entry before a Project entry)

Thanks for those super awesomely detailed explanation @twiro

@nitriques nitriques self-assigned this Aug 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants