Skip to:

Opened 2 months ago

Closed 2 months ago

#8401 closed defect (bug) (fixed)

Group Types: the bp_group_type_list() template tag can output empty links

Reported by: imath Owned by: imath
Milestone: 7.0.0 Priority: high
Severity: major Version:
Component: Groups Keywords: has-patch


If the Group Type's has_directory property is set to false and its show_in_list property is true, the Group type's directory url is empty and the template tag is using it into the href attribute of the link of the listed Group Type. Clicking on it, we are refreshing the current group's page.

Moreover, using the Group Type's name property into the text of the link is wrong as it's not the singular name, it's the plural one.

Moreover II, The label used before the group types list should only be plural if there are more than one Group Type listed

Attachments (1)

8401.patch (6.9 KB) - added by imath 2 months ago.

Download all attachments as: .zip

Change History (3)

2 months ago

#1 @imath
2 months ago

  • Keywords has-patch added; needs-patch removed

8401.patch is addressing the issues.

#2 @imath
2 months ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 12801:

Group Types: improve the bp_group_type_list() template tag

  • Make sure to avoid displaying empty links if the Group Types object’s has_directory property is set to false.
  • To improve consistency with the Groups directory message informing it is filtered according to a Group Type, use singular Group Type names for the texts used into the list.
  • Edit The $r['label'] argument of the bp_get_group_type_list() function so that it accepts an array containing the plural & singular labels to use according to the Group's number of group types it is assigned to.
  • Ensure backward compatibility in case developers are still using a string for this $r['label'] argument.

Fixes #8401

Note: See TracTickets for help on using tickets.