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
We wrote a deep channel copier that uses a channel as a template for other channels.
One of the issues we ran into is that the entity duplicators add -copy to slugs. Not a great key for a slug. So we figured, we'll copy the product to the target channel and then remove the -copy of the slug.
loads the slug independent of channel on a findOne basis (and therefore hits the slug from the source channel)
then loads the resulting product by id on a channel specific basis
resulting in a 404
Having globally unique slugs seems like a bug to me, especially within the context of a multi vendor marketplace
What imho should happen is load the product channel specifically left joining the translation slug. That would resolve the issue
@michaelbromley I'm willing to write a fix but since this is core functionality not sure if you agree or want me to touch it.
To Reproduce
Steps to reproduce the behavior:
Copy a product to another channel
Rename the slug back to the original slug
load the product by slug on the shop-api using the token for the new channel
404
Expected behavior
Product slugs should be unique on a per channel basis.
Environment (please complete the following information):
@vendure/core version: 2.2.3
Nodejs version 20
Database (mysql/postgres etc): postgres
Additional context
The text was updated successfully, but these errors were encountered:
Are you using the right approach? For what I know is that a product is assigned to a channel from the default channel and never is copied to a channel.
What I'm doing might be considered something that wasn't considered as a common scenario but that should be possible and highlights an unnecessary limitation. IMHO
Describe the bug
We wrote a deep channel copier that uses a channel as a template for other channels.
One of the issues we ran into is that the entity duplicators add -copy to slugs. Not a great key for a slug. So we figured, we'll copy the product to the target channel and then remove the -copy of the slug.
Unfortunately, the findOneBySlug function:
Having globally unique slugs seems like a bug to me, especially within the context of a multi vendor marketplace
What imho should happen is load the product channel specifically left joining the translation slug. That would resolve the issue
@michaelbromley I'm willing to write a fix but since this is core functionality not sure if you agree or want me to touch it.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Product slugs should be unique on a per channel basis.
Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: