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

Consider using Slug Driver system #1

Closed
askvortsov1 opened this issue Sep 4, 2021 · 2 comments · Fixed by #2
Closed

Consider using Slug Driver system #1

askvortsov1 opened this issue Sep 4, 2021 · 2 comments · Fixed by #2
Labels
enhancement New feature or request

Comments

@askvortsov1
Copy link

Hi! Flarum now comes with a slug driver system, where you can specify functions to map an abstract slug to/from a model instance. You could use this to implement this feature without editing the database directly.

For example, a User IdSlugDriver: https://github.com/flarum/core/blob/eed449a3ea3e898b7186ea39c80d7a09dbfd5fed/src/User/IdSlugDriver.php#L15-L15

@PipecraftNet
Copy link
Owner

@askvortsov1 Thanks for your suggestion. It would be better if it didn't edit the database.
I will look at the code about the slug driver system and try to implement this feature.

However, the sitemap extension(fof/sitemap) uses the value of the slug directly, so it is better to clear the value of the slug in the database now.
https://github.com/FriendsOfFlarum/sitemap/blob/master/src/Resources/Discussion.php#L31

@PipecraftNet PipecraftNet added the enhancement New feature or request label Sep 5, 2021
@askvortsov1
Copy link
Author

Good point! Opened an issue: FriendsOfFlarum/sitemap#30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants