Opened 11 years ago
Closed 11 years ago
#6894 closed defect (bug) (fixed)
BP Messages - Causes PHP Error - Wrong call of a function
| Reported by: | Jon Ziemlich | Owned by: | r-a-y |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.4.4 |
| Component: | Messages | Version: | 2.4.0 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
FIX: Remove line 104 at bp-messages/bp-messages-actions.php: $feedback = $send->get_error_message();
Hey there,
bp-messages/bp-messages-actions.php on line 104:
$feedback = $send->get_error_message();
The Variable $send is defined on line 87 $send = messages_new_message( ... .
The function messages_new_message is defined in bp-messages/bp-messages-functions.php
This function returns in no case an object. Only an int or bool.
So line 104 at bp-messages/bp-messages-actions.php is wrong and causes errors!
Thank you.
Best wishes
Jon Ziemlich
Attachments (1)
Change History (8)
#2
@
11 years ago
Sorry i saw now, that in some cases WP_Error Objects are returned. I will test it and send you as i know more.
#3
@
11 years ago
See [10286].
It does appear that there's one situation where a failed message post may result in false being returned: when $message->send() fails for a miscellaneous reason (such as a database error) near the end of messages_new_message(). @r-a-y we should probably do an error_type check here, right? Can we write a test that triggers this kind of failure?
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thank you for the report, @Jon Ziemlich.
How exactly are you causing this to fail? How did you discover the problem?