You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Vendure can not find collection by slug if 2 collection have the same slug in different channels.
To Reproduce
Steps to reproduce the behavior:
Create a channel A
Create a channel B
in the channel A create a collection with slug 'test'
in the channel B create a collection with slug 'test'
try to get the channel by slug test in channel B (or A if channel B works). For this you can use the collection query
Expected behavior
It should return the right collection
Environment (please complete the following information):
@vendure/core version: 2.0.6
Nodejs version : 18.17
Database (mysql/postgres etc): postgres
Additional context
After investigation, it’s because the first query in CollectionService findOneBySlug, is not contextualised with the channel, but the last query is.
So it gets all the collection matching the criteria → if severals it take the first of the list, then try to get the collection by ID on the channel, but because the selected item in the first query is not from the right channel it does not finds it.
The text was updated successfully, but these errors were encountered:
Describe the bug
Vendure can not find collection by slug if 2 collection have the same slug in different channels.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It should return the right collection
Environment (please complete the following information):
Additional context
After investigation, it’s because the first query in CollectionService findOneBySlug, is not contextualised with the channel, but the last query is.
So it gets all the collection matching the criteria → if severals it take the first of the list, then try to get the collection by ID on the channel, but because the selected item in the first query is not from the right channel it does not finds it.
The text was updated successfully, but these errors were encountered: