[buddypress-trac] [BuddyPress Trac] #6580: BP_Messages_Thread::$last_message_* not populated by default
buddypress-trac
noreply at wordpress.org
Thu Aug 6 15:48:18 UTC 2015
#6580: BP_Messages_Thread::$last_message_* not populated by default
---------------------------------+-----------------------------
Reporter: jdgrimes | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Component - Members | Version: 1.6
Severity: normal | Keywords:
---------------------------------+-----------------------------
The `BP_Messages_Thread` class offers some convenience fields that grant
direct access to the data for the last message in the thread:
- `last_message_id`
- `last_message_date`
- `last_sender_id`
- `last_message_subject`
- `last_message_content`
However, these are only populated by
`BP_Messages_Thread_Template::__construct()`, and were not documented in
`BP_Message_Thread` until [5999].
This caused me confusion when I was trying to use these fields in a
different context. To keep others from spending time chasing this down, I
suggest that we do one of the following:
1. Add a note to the inline docs for each of these fields stating that
they are only populated when using `BP_Messages_Thread_Template`.
1. Always populate them inside of the `BP_Message_Thread::populate()`
method.
I favor the latter.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6580>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list