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

Add unique slug to groups #1991

Closed
askvortsov1 opened this issue Feb 9, 2020 · 8 comments
Closed

Add unique slug to groups #1991

askvortsov1 opened this issue Feb 9, 2020 · 8 comments
Labels
stale Issues that have had over 90 days of inactivity

Comments

@askvortsov1
Copy link
Sponsor Member

Feature Request

Is your feature request related to a problem? Please describe.
Right now, groups are difficult to manage at scale, programatically. It's possible to sync groups via IDs, but the ID is the only unique field of groups. The group name is not unique, which means it's impossible to query the API for a particular group. Therefore, if I want to build a system that sets groups from an external source, I need to hardcode, or manually insert the IDs of each group.

Describe the solution you'd like
I propose that a unique "slug" field be added to groups. This would give a human readable (and manageable) lookup system for groups. For existing groups, the slug could be generated as a combo of the group name and id ( ex. admin-1), and further configurable in the admin panel.

Justify why this feature belongs in Flarum's core, rather than in a third-party extension
It's a change to groups themselves, so core would be a natural place for it. Additionally, it would be very useful to developers who want to extend groups functionality. The difficulty of managing groups at scale is a well known issue, and this would help move towards alleviating it.

@stale
Copy link

stale bot commented May 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum.
In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

@stale stale bot added the stale Issues that have had over 90 days of inactivity label May 9, 2020
@tankerkiller125
Copy link
Contributor

Keep for now, probably needs some discussion.

@stale stale bot removed the stale Issues that have had over 90 days of inactivity label May 9, 2020
@clarkwinkelmann
Copy link
Member

clarkwinkelmann commented Jun 8, 2020

Do we have additional use case for this? Most problems can be solved via the ID.

I do like the idea of a slug. But for forums that might handle many groups, I feel like this should be a nullable property.

The slug would make sense if it ended up in URLs somewhere. Is that likely or could the rare extension in need of this provide their own slug column?

@askvortsov1
Copy link
Sponsor Member Author

Someone could make a discussion that adds pages to groups, but it feels like user-directory might have that covered. My main concern is provisioning: if a group gets deleted by accident and recreated, the ID changes. Also, there isn't anything logical controlling the ID. But I do see your point that this isn't necessary for core (and an extension could definitely provide a slug column)

@tankerkiller125
Copy link
Contributor

One of the big things I could see this solving is inter forum sync, Notably I know that @askvortsov1 has the SSO Sync Extension that is able to sync groups. The problem however is that someone trying to do SSO between forums would need to create a mapping of groups between all the forums that they perform SSO on. Even if those groups have the same names. With slugs this would be drastically simplified since they would only need to make sure that all the forums have the same slugs.

@askvortsov1
Copy link
Sponsor Member Author

Yeah that explains what I was trying to say a lot better, thanks Matt! And one negative of adding it via an extension is that unlike many other things, if 2 extensions both try to add this column there can be some kinda nasty collisions (or conditional migrations which I think are bad practice)

@stale
Copy link

stale bot commented Sep 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum.
In any case, thanks for taking an interest in this software and contributing by opening the issue in the first place!

@stale stale bot added the stale Issues that have had over 90 days of inactivity label Sep 6, 2020
@stale
Copy link

stale bot commented Oct 7, 2020

We are closing this issue as it seems to have grown stale. If you still encounter this problem with the latest version, feel free to re-open it.

@stale stale bot closed this as completed Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues that have had over 90 days of inactivity
Projects
None yet
Development

No branches or pull requests

3 participants