Skip to:

Opened 4 years ago

Last modified 4 years ago

#8212 new enhancement

Do not use random number for resolve slug group conflict

Reported by: exoconsult's profile ExoConsult Owned by:
Milestone: Under Consideration Priority: low
Severity: trivial Version: 1.0
Component: Groups Keywords: reporter-feedback 2nd-opinion



An enhancement could be made on how slug of a group is created when there's a conflict (see groups_check_slug method in the file bp-groups-function.php - line 439)

At the moment, a random number is added at the end of the existing "default" slug group. But a better choice could be to iterate on a number until a non existing slug is found (the same way wordpress handles slug of a post).

See Worpdress method "wp_unique_post_slug" in file "wp-includes\post.php" (line 4294)


Change History (2)

#1 @johnjamesjacoby
4 years ago

  • Component changed from Core to Groups
  • Keywords reporter-feedback 2nd-opinion added
  • Milestone changed from Awaiting Review to Under Consideration
  • Priority changed from normal to low
  • Severity changed from normal to trivial
  • Version set to 1.0

a better choice could be to iterate on a number until a non existing slug is found

Why is an incremental number better than a random one?

The reasons random slugs are used is because group slugs can be changed later, and random slugs cannot be enumerated through as easily if someone is trying to guess whether or not a group exists, either before or after it has been finalized by the creator.

WordPress sites generally have fewer content creators, making incremental numbers simpler to manage because authors are usually working together anyways. In a Community site, where Group creation is likely to be open to all Members, a random number also dramatically reduces the probability of a slug collision, in the event multiple Members happen to be attempting to create a Group with the same base slug at around the same time.

Open to hearing different opinions and suggestions here though!

#2 @ExoConsult
4 years ago

Yeah. That's a good point of view...

Note: See TracTickets for help on using tickets.