#6193 closed defect (bug) (fixed)
Displaying member types within members loop fails
Reported by: | imath | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.2.1 | Priority: | normal |
Severity: | normal | Version: | 2.2 |
Component: | Members | Keywords: | has-patch |
Cc: |
Description
I've been pinged by this topic https://buddypress.org/support/topic/bp_get_member_type-is-not-working-in-the-loop/ then tried to understand what was going wrong.
I think the problem is due to the fact bp_members_prefetch_member_type()
is caching a string and bp_get_member_type()
needs an array as it uses array_pop()
So i suggest the attached patch to be sure to cache all potentiel member types assigned to a user.
Attachments (2)
Change History (8)
#2
@
10 years ago
- Milestone changed from Awaiting Review to 2.2.1
This definitely needs unit tests. Thanks for the catch.
#4
@
10 years ago
Thanks, imath. Just to clarify a bit for posterity's sake: The 2.2 implementation of member type caches was meant to store arrays of member types; see bp_get_member_type()
for an example. However, the prefetch
function (and its unit test) was mistakenly written to cache string values.
I'm going to rewrite the logic here to be just a little bit less opaque, and fix it in trunk and on the branch.
Sorry, i wasn't able to run the unit tests to check everything was ok, will do soon