-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Fix: Bad Title.path in Multilanguage sites if parent slug is created or modified #6968
Conversation
@Aiky30 yes, please start to review this PR. I have just added in Related resources the two bug descriptions. These bugs are also tested now in cms/tests/test_titlepath.py file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your effort on this issue.
I hope that you agree with the feedback and if you need any help please reach out and we can discuss any of your concerns in depth.
cms/tests/test_titlepath.py
Outdated
|
||
class TitlePathTestCase(CMSTestCase): | ||
|
||
def test0001_translated_subpage_title_path(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pleae name the tests consistently with the other tests in the project. Maybe: "test_translated_subpage_slug_generation_for_pages_with_different_language_translations"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New name is:
"test_translated_subpage_title_path_regeneration"
@victor-yunenko This will need your review as this is directly related to an issue that you have raised. :-) |
I would like to write tests similar to "test_translated_subpage_title_path_regeneration" and "test_subpage_title_path_regeneration_after_parent_slug_change", but at form level. Precisely to exercise cms.forms.ChangePageForm.save. Any advice ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My apologies for what may look like a lot of minor changes. I have only added them because the PEP 008 validation will fail due to 2 lines between the test functions. We may as well do a little more clean up at the same time.
You can accept or reject each suggestion using Github and will require no "manual" code changes. This should be a very easy task in the Github user interface. :-)
Required by PEP008 validation Co-authored-by: Aiky30 <Aiky30@users.noreply.github.com>
Remove empty line break Co-authored-by: Aiky30 <Aiky30@users.noreply.github.com>
Comment enhancement Co-authored-by: Aiky30 <Aiky30@users.noreply.github.com>
Comment enhancement Co-authored-by: Aiky30 <Aiky30@users.noreply.github.com>
Remove empty line as required by PEP 008 Co-authored-by: Aiky30 <Aiky30@users.noreply.github.com>
Remove an empty line Co-authored-by: Aiky30 <Aiky30@users.noreply.github.com>
Thanks @Aiky30 for code polishing. It is simple to accept your suggestions. Maybe I should have used the "batch..." button. Unfortunately this button is not clear for me. I hope there will be a rebase before merging. |
Glad that it made it easy. We are obviously super grateful for your contribution and want to make it as easy as possible by also improving the codebase with tests. :-) We just need a final sign off from @victor-yunenko and then we can look to merge it and then maybe backport it into a version if this is blocking people. |
@fp4code to bring the branch back up to date are yiu able to pull upstream master onto you branch? You may have to set upstream for that to work. |
Hi @Aiky30, I can do what you want but I'm not sure to understand exactly what is required. For example, I can
Eventually, I have done 1), created c2n-dju:master and done 2). Is it what you want? Why "master"? Maybe, you want a branch "fp-fix6622-on-3.8.0"? Please, let me know! |
Hi @fp4code, I'm not sure if there's a quicker way mut o do the following to be sure that I have the latest. If I'm on a current working branch then I first move back out to my forked master: ''' It might be possible to pull the latest changes straight in by git pull upstream master. I'll need to test this out in future. |
The pr no longer states that it's out of date so you must have done the update successfully. :-) |
I have done the same things, but with "develop" instead of "master". There is no "master" branch in django-cms I think. |
Thanks @Aiky30 |
Sorry I made a confusion about closing button (my idea was to "close" a small discussion thread, not the PR of course!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this change, thanks for your persistence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me 👍
…created or modified (django-cms#6968).
Description
Fix #6622 Bad Title.path in Multilanguage sites if parent slug is created or modified
Just a reopening of PR #6965
Related resources
First bug:
In 'en','fr' site
As a result, the path of subpage "fr-1-1" is not updated. Here the paths:
/en/en-1/
/en/en-1/en-1-1/
/fr/fr-1/
/fr/en-1/fr-1-1/ <-- Bad Title.path "en-1/fr-1-1" instead of "fr-1/fr-1-1"
Second bug:
Change "en" slug of /en/en-1/ page to "en-1b",
As a result the path of subpage "en-1-1" is changed to "fr-1/en-1-1" instead of "en-1b/en-1-1". Here the paths:
/en/en-1b/
/en/fr-1/en-1-1/ <-- Bad Title.path "fr-1/en-1-1" instead of "en-1b/fr-1-1"
/fr/fr-1/
/fr/en-1/fr-1-1/ <-- Bad Title.path "en-1/fr-1-1" instead of "fr-1/fr-1-1"
Checklist
develop