Opened 9 years ago
Closed 9 years ago
#6894 closed defect (bug) (fixed)
BP Messages - Causes PHP Error - Wrong call of a function
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.4.4 | Priority: | normal |
Severity: | normal | Version: | 2.4.0 |
Component: | Messages | 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)
#1
@
9 years ago
- Cc bp-messages-actions.php removed
- Priority changed from highest to normal
- Severity changed from blocker to normal
#2
@
9 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
@
9 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?
Thank you for the report, @Jon Ziemlich.
How exactly are you causing this to fail? How did you discover the problem?