[wp-trac] [WordPress Trac] #45253: "Unhandled promise rejection" in 5.0-RC2

WordPress Trac noreply at wordpress.org
Thu Feb 21 16:51:37 UTC 2019


#45253: "Unhandled promise rejection" in 5.0-RC2
--------------------------+-------------------------
 Reporter:  jsmoriss      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Editor        |     Version:  5.0
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript
--------------------------+-------------------------
Changes (by Chouby):

 * keywords:   => has-patch


Comment:

 I encountered the same issue. In fact we get this error because it's
 currently not possible to use the function `use_block_editor_for_post()`
 when `$_GET['meta-box-loader']` is set, due to the `check_admin_referer()`
 always failing in this function.

 When updating the post in the block editor, it fires a POST request such
 as:
 {{{
 http://mysite.com/wp-admin/post.php?post=145&action=edit&meta-box-
 loader=1&_wpnonce=1c971368b2&_locale=user
 }}}

 This request includes two different parameters `_wp_nonce`. One in
 `$_GET`, the other in `$_POST`. `check_admin_referer()` uses `$_REQUEST`,
 so takes the value of `$_POST`. Thus `check_admin_referer( 'meta-box-
 loader' )` fails as it expects the value included in `$_GET`.

 Changing one of the 2 nonces name fixes the issue.

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


More information about the wp-trac mailing list