• I recently moved my wp directories and db from one machine to another. Everything seems to be working fine except for emailed blogs. I’ve tried this with the stock wp-mail.php and John Blade’s updated version and the same thing happens.
    The syptom is emailed blogs get an PHP error when trying to access their category. I get this when viewing the post:
    Warning: Invalid argument supplied for foreach() in /www/httpd/blog/wp/wp-includes/template-functions-category.php on line 65
    This happens on the blog page as well as on the edit page. On the edit page the list of categories is preceded by a series of php errors. No category is selected for this post. If I simply publish the post again from the edit page the warning goes away.
    When an emailed post is processed it should get deleted via the POP3 interface. But in this case the post is created (sans a valid entry in wp_post2cat – that doesn’t get created) and the mail file under the Maildir is left intact.
    I traced this down to one line in wp-mail.php that calls do_action(‘publish_post’, $post_ID). If I comment this line out of wp-mail.php then the posts are properly handled. If I leave this line in then the pop3 stuff doesn’t complete and I get errors in the processing of categories. It appears php dies and doesn’t return when this do_action() function is called.
    This may have broken when I xfer’d over the wp dirs and db though I’ve since reinstalled all the wp files to no avail. Maybe its a broken config in my db? Do I need this call to do_action()? I can’t really tell what it does – it appears to be a front end to the plugins and I’m not sure which one its calling (I have no plugins activated, btw).
    FWIW, if I leave this line commented out, the email blogging works, I do not get the PHP Warning message, the post has the proper category and the rest of my wp system appears to be functioning smoothly. So maybe I should just leave this call out?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘do_action(‘publish_post’,…) failing with email’ is closed to new replies.