[wp-trac] [WordPress Trac] #31808: Press This: unhelpful error message on post save failure.

WordPress Trac noreply at wordpress.org
Mon Mar 30 14:12:29 UTC 2015


#31808: Press This: unhelpful error message on post save failure.
--------------------------+--------------------
 Reporter:  stephdau      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.2
Component:  Press This    |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------
Description changed by stephdau:

Old description:

> We use a generic error message when we fail to save the post, which can
> be due something as simple as not having post title and content:
> https://cloudup.com/c9uxsiqQOIU
>
> {{{
> if ( is_wp_error( $updated ) || intval( $updated ) < 1 ) {
>         wp_send_json_error( array( 'errorMessage' => __( 'Error while
> saving the post. Please try again later.' ) ) );
> } else {
> }}}
>
> We should instead use `$updated->get_error_message()` to let the user
> know exactly what happened: https://cloudup.com/cT5H53fr5Ic
>
> See attached patch.

New description:

 We use a generic error message when we fail to save the post, which can be
 due something as simple as not having post title and content:
 https://cloudup.com/c9uxsiqQOIU

 {{{
 if ( is_wp_error( $updated ) || intval( $updated ) < 1 ) {
         wp_send_json_error( array( 'errorMessage' => __( 'Error while
 saving the post. Please try again later.' ) ) );
 } else {
 }}}

 We should instead use `$updated->get_error_message()` to let the user know
 exactly what happened: https://cloudup.com/cT5H53fr5Ic

 See attached patch.

 Originally reported here: https://wordpress.slack.com/archives/core-
 pressthis/p1427516975000306

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31808#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list