When a user forgets to input their ping.fm application key and the module is turned on, and interesting error occurs. It seems Ping.fm tries to fire off the submission anyway, and the result is below.

"Fatal error: Call to a member function post() on a non-object in /module/path/pingfm.module on line 231"

interestingly enough, this was tested submitting new blog content and the blog still posted, though there is no one way to know that without manually checking after receiving the fatal error. This could lead to users double submitting blog posts if they attempt to go back and resubmit without first checking to see if the blog posted.

Comments

Steven Brown’s picture

There is error in the logic that checks whether or not this post should be allowed to be posted to the ping.fm service. As long as you have your application key in the module and you have it configured properly this will not be an issue.

If there isn't a global or user key then we should not be trying to post to ping.fm

drakythe’s picture

Would it be possible to wrap those 4 lines of code (234-237 in dev version) in a if statement? Something like

if !empty($account)
  function pingfm_post($body, $post_method = 'default', $title = NULL, $account = NULL) {
    $pingfm = pingfm_phpingfm($account);
    return $pingfm->post($post_method, $body, $title);
  }
else drupal_set_message(t("Note: Your ping.fm key is not set and so this was not pushed to ping.fm"));

I haven't double checked to make sure $account is empty to begin with, but assuming (I know, ass-u-me) and I have no idea if skipping this function will hurt something, but this hit me and I thought I'd throw it out there before I forgot.

Steven Brown’s picture

Status: Active » Closed (fixed)

Module is Obsolete please read project description.

Steven Brown’s picture

Issue summary: View changes

edited module path