Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 2 years ago

#8752 closed defect (bug) (worksforme)

Member List Fails to Display When Adminstering Group

Reported by: pgrafix's profile pgrafix Owned by: imath's profile imath
Milestone: Priority: normal
Severity: normal Version: 10.4.0
Component: Groups Keywords: reporter-feedback
Cc:

Description

Member list fails to load on the group admin front end or back end for a single group after adding a multiple members in a single addition.

Console errors:

Chrome:

Uncaught TypeError: Cannot read properties of undefined (reading ‘name’)
    at eval (eval at template (underscore.min.js?ver=1.13.1:2:15327), <anonymous>:29:18)
    at n (underscore.min.js?ver=1.13.1:2:15407)
    at n.template (wp-util.min.js?ver=350dcb35f552474cc66408105b81368d:2:323)
    at n.render (wp-backbone.min.js?ver=350dcb35f552474cc66408105b81368d:2:2893)
    at wp.Backbone.Subviews.<anonymous> (wp-backbone.min.js?ver=350dcb35f552474cc66408105b81368d:2:2140)
    at underscore.min.js?ver=1.13.1:2:6433
    at Function.dr (underscore.min.js?ver=1.13.1:2:9528)
    at wp.Backbone.Subviews._attach (wp-backbone.min.js?ver=350dcb35f552474cc66408105b81368d:2:2101)
    at wp.Backbone.Subviews.set (wp-backbone.min.js?ver=350dcb35f552474cc66408105b81368d:2:884)

FF (underscore.min.js:29:1):

Uncaught TypeError: data.role is undefined
    Underscore 2
    template https://mydomain/wp-includes/js/wp-util.min.js?ver=350dcb35f552474cc66408105b81368d:2
    Backbone 2
    Underscore 2
    Backbone 3
    addListTableRows Ember
    Underscore 2
    addListTableRows Ember
    Backbone 5
    initialize Ember
    Backbone 4
    initialize Ember
    Backbone 4
    Ember 2
    underscore.min.js:29:1

Safari:

TypeError: undefined is not an object (evaluating ‘data.role.name’)
    anonymous (Anonymous Script 1 (line 28))
    n (underscore.min.js:2:15412)
    (anonymous function) (wp-util.min.js:2:324)
    render (wp-backbone.min.js:2:2902)
    (anonymous function) (wp-backbone.min.js:2:2147)
    (anonymous function) (underscore.min.js:2:6438)
    dr (underscore.min.js:2:9530)
    _attach (wp-backbone.min.js:2:2106)
    set (wp-backbone.min.js:2:892)
    add (wp-backbone.min.js:2:1005)
    (anonymous function) (manage-members.min.js:1:8475)
    (anonymous function) (underscore.min.js:2:6438)
    dr (underscore.min.js:2:9530)
    addListTableRows (manage-members.min.js:1:8439)
    p (backbone.min.js:2:3194)
    f (backbone.min.js:2:2931)
    a (backbone.min.js:2:843)
    (anonymous function) (backbone.min.js:2:2815)
    reset (backbone.min.js:2:10387)
    initialize (manage-members.min.js:1:8226)
    (anonymous function) (backbone.min.js:2:14145)
    constructor (wp-backbone.min.js:2:2606)
    (anonymous function) (backbone.min.js:2:23432)
    (anonymous function) (backbone.min.js:2:23432)
    initialize (manage-members.min.js:1:9254)
    (anonymous function) (backbone.min.js:2:14145)
    constructor (wp-backbone.min.js:2:2606)
    (anonymous function) (backbone.min.js:2:23432)
    (anonymous function) (backbone.min.js:2:23432)
    (anonymous function) (manage-members.min.js:1:9325)
    Global Code (manage-members.min.js:1:9369)

Removing the added members from the group via the database restores the displaying of the member list. Adding any one of them back to the group immediately stops the member list from displaying again.

Have traced the issue to potentially line 89 of /buddypress/bp-templates/bp-nouveau/buddypress/common/js-templates/group-members/index.php

88 <# if ( ! data.editing  && ! data.managingBan && ! data.removing ) { #>
89			{{data.role.name}}
90		<#} else {

If I remove {{data.role.name}} the list of members is restored in both the front and back end. However, removal of this block of code also removes the member's role display in the Roles column under Manage Members.

Attachments (1)

Screen Shot 2022-10-08 at 4.38.41 PM.png (49.7 KB) - added by pgrafix 2 years ago.
Screen shot of the affected Manage Members section of the group

Download all attachments as: .zip

Change History (6)

#1 @pgrafix
2 years ago

One additional error statement:

TypeError: data.role is undefined /wp-includes/js/underscore.min.js?ver=1.13.1 line 2 > Function line 29

Updating this file (and underscore.js) to the latest version (1.13.6) doesn't alleviate the issue.

Last edited 2 years ago by pgrafix (previous) (diff)

@pgrafix
2 years ago

Screen shot of the affected Manage Members section of the group

#2 @imath
2 years ago

  • Component changed from Templates to Groups
  • Keywords reporter-feedback added
  • Priority changed from high to normal

Hi @pgrafix

Thanks a lot for your feedback, screenshots and error console information. I've just tried to reproduce adding 2 new members to the group and everything works as expected, see the screenshot below:

https://cldup.com/BjoooyAP2u.png

Have you made sure to deactivate all plugins but BuddyPress, remove any plugins/bp-custom.php or mu-plugins/* files and temporarily switch to a WordPress default before checking it was a BuddyPress issue ?

#3 @pgrafix
2 years ago

I have:

  • Tested for plugin conflicts. Even stripped down to just BP running, but issue persists.
  • Tested for theme issues. Issue persists.
  • Disabled bp-custom. Issue persists.
  • Restored theme functions.php to default. Issue persists.
  • Nothing in the server error logs.
Version 0, edited 2 years ago by pgrafix (next)

#4 @imath
2 years ago

  • Owner set to imath
  • Status changed from new to reviewing

Thanks for your reply, I’ll test it again with a 10.4 build, I guess I might not see the issue with trunk and latest BP REST API.

#5 @imath
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from reviewing to closed

I've just tested with BP 10.4.0 and WP 6.0.2 (instead of development versions of BP, WP, and the BP REST API).

I wasn't able to reproduce. So everything is fine to me.

Note: See TracTickets for help on using tickets.