[2.x] feat(core, mentions, likes): implement IdWithDisplayNameSlugDriver#4470
Open
DavideIadeluca wants to merge 5 commits intoflarum:2.xfrom
Open
[2.x] feat(core, mentions, likes): implement IdWithDisplayNameSlugDriver#4470DavideIadeluca wants to merge 5 commits intoflarum:2.xfrom
IdWithDisplayNameSlugDriver#4470DavideIadeluca wants to merge 5 commits intoflarum:2.xfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation PR at flarum/docs#514
Fixes #0000
Changes proposed in this pull request:
Implements a new slug driver for
User. This slug driver works very similarly to theDiscussionSlug driver in that that the id is used as the main mechanism for routing, but the models slug added for cosmetics.Modifies the frontend routes extender to support adding a custom resolver class. The new
UserPageResolveris needed to patch the URL in case the user has changed their username/nickname.Example:
http://localhost/u/1-nonsense-slug-which-is-not-the-actual-user-or-nickname/likesis replaced withhttp://localhost/u/1-admin-username/likesReviewers should focus on:
Should in theory be backwards compatible. Needs a accompanying documentation PR for extension developers to start to consume the
UserPageResolverwhen adding routes like this:Screenshot
Necessity
Confirmed
composer test).Required changes: