mirror of
https://github.com/WordPress/WordPress.git
synced 2024-06-30 00:34:57 +02:00
REST API: JS Client - improve collection route construction for empty parents.
Fix an issue where the constructed path for hierarchical collections could contain a double slash ("//") when items contained empty parents, causing an error. Props nicomollet. Fixes #44745. Built from https://develop.svn.wordpress.org/trunk@49390 git-svn-id: http://core.svn.wordpress.org/trunk@49149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9c5173ffa6
commit
b8d1d01cc5
|
@ -1412,8 +1412,11 @@
|
||||||
// Function that returns a constructed url passed on the parent.
|
// Function that returns a constructed url passed on the parent.
|
||||||
url: function() {
|
url: function() {
|
||||||
return routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) +
|
return routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) +
|
||||||
parentName + '/' + this.parent + '/' +
|
parentName + '/' +
|
||||||
routeName;
|
( ( _.isUndefined( this.parent ) || '' === this.parent ) ?
|
||||||
|
( _.isUndefined( this.get( 'parent_post' ) ) ? '' : this.get( 'parent_post' ) + '/' ) :
|
||||||
|
this.parent + '/' ) +
|
||||||
|
routeName;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Specify the model that this collection contains.
|
// Specify the model that this collection contains.
|
||||||
|
|
2
wp-includes/js/wp-api.min.js
vendored
2
wp-includes/js/wp-api.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.6-beta2-49388';
|
$wp_version = '5.6-beta2-49390';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user