#6262 closed defect (bug) (fixed)
No 'type' property in BP_Core_Members_Template
Reported by: | henry.wright | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Members | Keywords: | |
Cc: |
Description
In the constructor for BP_Core_Members_Template
, I'm seeing $type
being assigned to a property: $this->type = $type
But I don't see where the type
property is declared in that class? The class doesn't extend another class either.
A forum member has mentioned they are having problems with the sort order. See:
https://buddypress.org/support/topic/only-one-result-for-certain-types-in-members-loop/
Change History (7)
#2
@
10 years ago
Yep, it's passed to the constructor and then in the constructor it's assigned to a property. For example: $this->type = $type
. But shouldn't that property be defined in the class definition? Something like:
class BP_Core_Members_Template { public $type; // etc... }
It doesn't seem to be in this case. Not sure if that would cause issues?
#3
@
10 years ago
- Keywords reporter-feedback close removed
- Milestone changed from Awaiting Review to 2.3
Ah, I see - sorry for not understanding before. Not having it defined in the class definition shouldn't cause any technical problems, but the documentation should be provided in any case.
#4
@
10 years ago
- Owner set to boonebgorges
- Resolution set to fixed
- Status changed from new to closed
In 9563:
#5
follow-up:
↓ 6
@
10 years ago
Regarding the docblock summary "The type of member being requested. Used for ordering results", is it worth making it clearer that the attribute is nothing to do with the new member type feature? Because this particular attribute is more to do with the sort order, 'active', 'random', 'newest', 'popular'.
#6
in reply to:
↑ 5
@
10 years ago
Replying to henry.wright:
Regarding the docblock summary "The type of member being requested. Used for ordering results", is it worth making it clearer that the attribute is nothing to do with the new member type feature? Because this particular attribute is more to do with the sort order, 'active', 'random', 'newest', 'popular'.
I feel like the documentation to BP_Core_Members_Template::__construct()
and especially BP_User_Query
makes this point pretty clear. But if you have a suggestion for wording, feel free to write up a patch and reopen this ticket.
$type
is the first variable passed to the constructor. See https://buddypress.trac.wordpress.org/browser/trunk/src/bp-members/bp-members-template.php#L546. Are you seeing PHP notices or anything like that?