Opened 11 years ago
Closed 11 years ago
#6580 closed defect (bug) (fixed)
BP_Messages_Thread::$last_message_* not populated by default
| Reported by: | jdgrimes | Owned by: | boonebgorges |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.4 |
| Component: | Messages | Version: | 1.6 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
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_idlast_message_datelast_sender_idlast_message_subjectlast_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:
- Add a note to the inline docs for each of these fields stating that they are only populated when using
BP_Messages_Thread_Template. - Always populate them inside of the
BP_Message_Thread::populate()method.
I favor the latter.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Always populate the fields