-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Avoid cloning the AutoroutePart pattern in the localized content #15810
Conversation
There's might be a better solution, but this the quick one that I go with, @MichaelPetrinolis could you please try the PR |
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.
If adding a dependency to Autoroute Core is ok, clearing the autoroutepart path does the job. Either it is draftable or not, the localized version has empty path and the user is able to update eg. the localized title and create a localized route. Thanx!
I tried to avoid depending on /cc @Skrypt |
src/OrchardCore.Modules/OrchardCore.ContentLocalization/DefaultContentLocalizationManager.cs
Outdated
Show resolved
Hide resolved
@coderabbitai review |
WalkthroughWalkthroughThe update involves improving the content localization process in OrchardCore by automatically regenerating permalinks when content is localized. This enhancement ensures that the autoroute path is correctly handled during localization, addressing a specific issue related to culture names in the path pattern. Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Seems coderabbitai ignores my PR :) |
Hmm, it seems it didn't actually do a review. I've asked the CR team about this. |
@MichaelPetrinolis the new update might much better |
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.
Actionable comments posted: 0
Out of diff range and nitpick comments (1)
src/OrchardCore.Modules/OrchardCore.ContentLocalization/Handlers/AutoPartContentLocalizationHandler.cs (1)
11-19
: The logic to clear theAutoroutePart
path is correctly implemented to support automatic permalink regeneration.Consider adding a comment explaining why the path is set to null, for future maintainability.
...dCore.Modules/OrchardCore.ContentLocalization/Handlers/AutoPartContentLocalizationHandler.cs
Outdated
Show resolved
Hide resolved
...dCore.Modules/OrchardCore.ContentLocalization/Handlers/AutoPartContentLocalizationHandler.cs
Outdated
Show resolved
Hide resolved
...dCore.Modules/OrchardCore.ContentLocalization/Handlers/AutoPartContentLocalizationHandler.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutorouteContentLocalizationHandler.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutorouteContentLocalizationHandler.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutorouteContentLocalizationHandler.cs
Show resolved
Hide resolved
I already tried many times without luck, and I will try one more time, otherwise let us accept this while it fixes a real issue then we could revise the places that we are using |
This pull request has merge conflicts. Please resolve those before requesting a review. |
for instructions on how to resolve the merge conflicts due to #16572 please follow the step listed in this comment. |
It seems that this pull request didn't really move for quite a while. Is this something you'd like to revisit any time soon or should we close? Please comment if you'd like to pick it up. |
src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutorouteContentLocalizationHandler.cs
Outdated
Show resolved
Hide resolved
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.
@hishamco I fixed a merge error in the startup. Also I think there has been some fixes, you can go with Alter
now and we can finalize this.
src/OrchardCore.Modules/OrchardCore.Autoroute/Handlers/AutorouteContentLocalizationHandler.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Georg von Kries <[email protected]>
Do you mean the one that you suggested? |
@Piedone, it seems we forgot this one, is there anything else we should add? |
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.
Well, I was waiting for you to address the latest comments and request review again :).
[RequireFeatures("OrchardCore.Autoroute")] | ||
public class AutoPartStartup : StartupBase |
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 suppose this should rather be?
[RequireFeatures("OrchardCore.Autoroute")] | |
public class AutoPartStartup : StartupBase | |
[RequireFeatures("OrchardCore.ContentLocalization")] | |
public class LocalizationStartup : StartupBase |
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.
ContentLocalizationStartup
will be better, to avoid the conflict between localization & content localization modules
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.
BTW I didn't notice there was other feedback except your latest comments. Are there any?
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.
ContentLocalizationStartup
will be better, to avoid the conflict between localization & content localization modules
Sure.
BTW I didn't notice there was other feedback except your latest comments. Are there any?
No.
Frankly, I lost because there were many comments |
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.
@gvkries please merge if OK from your side too.
Fixes #15805
Summary by CodeRabbit
New Features
Refactor
Documentation