Skip to:
Content

BuddyPress.org

Opened 5 months ago

Last modified 3 weeks ago

#8410 new enhancement

Admin Type order of field for creation of new type

Reported by: Jean-David Owned by: slaFFik
Milestone: Awaiting Contributions Priority: low
Severity: minor Version:
Component: Administration Keywords: has-patch reporter-feedback
Cc:

Description

When creating a new Type in Group Type or Member Type in the 7 version of BP, it is confusing to have the first field to be the slug one.
In WordPress, when defining a category, the first one is the name of the category and then the slug is automatically deducted from the name.
I think it would be much mincer to stay in the WP spirit and muscle memory.

https://imgur.com/a/tNFOR6O for example

Attachments (2)

8410.diff (2.1 KB) - added by Jean-David 5 months ago.
As the names are just metadatas, I needed a way to distinguish between the types of the field. I refactored the code into a private function, which is called twice : one before the slug field, and the other after, allowing to filter the field between the "name ones" and the "not name ones"
8410.2.diff (979 bytes) - added by Jean-David 5 months ago.

Download all attachments as: .zip

Change History (9)

#1 @Jean-David
5 months ago

  • Type changed from defect (bug) to enhancement

#2 @imath
5 months ago

  • Keywords needs-patch added; reporter-feedback removed
  • Milestone changed from Awaiting Review to Awaiting Contributions

Hi,

I'm not opposed to reversing the order of these fields and to suggest a Member/Group Type ID according to the singular name. I'd be happy to see a patch about it.

@Jean-David
5 months ago

As the names are just metadatas, I needed a way to distinguish between the types of the field. I refactored the code into a private function, which is called twice : one before the slug field, and the other after, allowing to filter the field between the "name ones" and the "not name ones"

#3 @Jean-David
5 months ago

I added a first patch for the ordering of the fields in the BP Type admin feature.
But I'd like to add another patch with the automatic slug from name feature soon.

@Jean-David
5 months ago

#4 @Jean-David
5 months ago

  • Keywords has-patch dev-feedback added; needs-patch removed
  • Milestone changed from Awaiting Contributions to Awaiting Review

This second patch gives a bp_type_id id not already defined and if the bp_type_singular_name is not empty.

I changed a translation to reflect the changes.
I'd like a code review on the two patches.

#5 @imath
5 months ago

  • Milestone changed from Awaiting Review to 8.0.0

#6 @imath
4 weeks ago

  • Keywords reporter-feedback added; dev-feedback 2nd-opinion removed

Hi thanks for your patches. The first one can be difficult to understand, what about injecting the type's ID into the array of registered meta right after the plural name?

About the 2nd patch: it looks good, but as the type's ID is used by default if no custom slug has been set, the plural name should probably be the value to use so that when the members directory is filtered by a type, the url looks like site.url/members/type/contributors

#7 @imath
3 weeks ago

  • Milestone changed from 8.0.0 to Awaiting Contributions

Moving this ticket to the Awaiting contributions milestone, don't hesitate to move it back to the current major release in case of progress.

Note: See TracTickets for help on using tickets.