WordPress.org

Ready to get started?Download WordPress

Forums

Edit Flow
Possible bug with Submit for Review notifications (3 posts)

  1. Brad Williams
    Member
    Posted 2 years ago #

    I ran into a problem today where notification emails were not being sent when a post status is changed from Draft to Pending Review.

    I created a plugin to auto-assign a user group to all 'pending' statuses as shown here: http://editflow.org/extend/auto-subscribe-user-groups-for-notifications/

    That works great. The problem I ran into is the email was never sent to the user group when a new post was set to pending. Here are the steps to reproduce:

    1. Login as a Contributor
    2. Create a brand new post and save as draft
    3. Submit post for Review

    The problem is line 324 in notifications.php $old_status was coming through as 'pending', even though the old post status was actually a draft, so the notification trigger didn't happen.

    I was able to make a workaround using the ef_notification_ignored_statuses filter, but there seems to be a larger issue at play here.

    Let me know if you need anymore details

    http://wordpress.org/extend/plugins/edit-flow/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Sorry for the late reply on this. I'll have time to test and see if I can reproduce tomorrow or this weekend

  3. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Finally got around to testing this. I'm having trouble reproducing though. I've added the following to notifications.php:

    function notification_status_change( $new_status, $old_status, $post ) {
    		global $edit_flow;
    
    		static $number;
    		$number++;
    		error_log( 'number: ' . $number );
    		error_log( 'old status: ' . $old_status );
    		error_log( 'new status: ' . $new_status );

    This is what I see happening:

    [02-Jun-2012 05:13:56] number: 1
    [02-Jun-2012 05:13:56] old status: new
    [02-Jun-2012 05:13:56] new status: inherit
    [02-Jun-2012 05:13:56] number: 2
    [02-Jun-2012 05:13:56] old status: draft
    [02-Jun-2012 05:13:56] new status: pending

    The hook is fired twice obviously, but the first time is ignored because 'inherit' is an ignored status. The second time follows what I'd expect.

    Can you share any local modifications you've made, and how you're applying your filters? Also, similar debug output would be useful. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic