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,7 +1412,10 @@
|
|||
// Function that returns a constructed url passed on the parent.
|
||||
url: function() {
|
||||
return routeModel.get( 'apiRoot' ) + routeModel.get( 'versionString' ) +
|
||||
parentName + '/' + this.parent + '/' +
|
||||
parentName + '/' +
|
||||
( ( _.isUndefined( this.parent ) || '' === this.parent ) ?
|
||||
( _.isUndefined( this.get( 'parent_post' ) ) ? '' : this.get( 'parent_post' ) + '/' ) :
|
||||
this.parent + '/' ) +
|
||||
routeName;
|
||||
},
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @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.
|
||||
|
|
Loading…
Reference in New Issue