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

Homographs in slugs for different pages and different languages should not raise MultipleObjectsReturned #3548

Closed
3 tasks
evildmp opened this issue Oct 30, 2014 · 5 comments · Fixed by #7144
Closed
3 tasks
Assignees
Milestone

Comments

@evildmp
Copy link
Contributor

evildmp commented Oct 30, 2014

Your site has two sibling pages:

# a page about sticks
/it/bastone
/fr/canne
/en/cane

# a page about dogs
/it/cane
/fr/chien
/en/dog

At present, as soon as you try to publish (it will let you save a draft) the Italian translation, you'll get:

MultipleObjectsReturned at /it/cane/
get() returned more than one Page -- it returned 2!

Issues to be decided:

  • should we allow the creation of the slug? We would need to stop ignoring the language prefix when processing URLs.
  • if we do, how would we decide what serve when the user asked for /fr/cane/ - should it serve up chien or canne (see We should redirect when serving a "guessed" page #3547 on django CMS's page-guessing behaviour)
  • if we don't, we should advise the user of a slug conflict, instead of raising the MultipleObjectsReturned error.
@yakky
Copy link
Member

yakky commented Nov 2, 2014

To me the right solution here is to change https://github.com/divio/django-cms/blob/develop/cms/utils/page_resolver.py#L64 to match the path honouring to the current language (so cane will return /it/cane/ if the current language is italian and /en/cane/ if it's english)

@yakky
Copy link
Member

yakky commented Feb 22, 2015

@evildmp @ojii @mkoistinen further opinion on this?
I don't think we could handle this in 3.1

@mkoistinen
Copy link
Contributor

I have no further opinion, the way you outlined it above is the correct way this should be done, IMO.

@yakky yakky modified the milestones: 3.X, 3.1 Mar 1, 2015
@FinalAngel FinalAngel modified the milestones: Clean up issues & pull requests, 3.X Oct 29, 2015
@Aiky30 Aiky30 self-assigned this Oct 15, 2020
@NicolaiRidani NicolaiRidani added the Hacktoberfest https://hacktoberfest.digitalocean.com/ label Oct 1, 2021
@stale
Copy link

stale bot commented Jun 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 30, 2022
@stale
Copy link

stale bot commented Jul 28, 2022

This will now be closed due to inactivity, but feel free to reopen it.

@stale stale bot closed this as completed Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants