mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-17 03:56:07 +00:00
Use Math.round()
instead of Math.floor()
when determining page of attachments to query in wp.media.model.Query.sync
.
This was causing an infinite loop of AJAX requests - so.... good catch! Props Veritaserum. Fixes #31116. Built from https://develop.svn.wordpress.org/trunk@31406 git-svn-id: http://core.svn.wordpress.org/trunk@31387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6cb16f7a21
commit
64e19e98a3
@ -1230,7 +1230,7 @@ Query = Attachments.extend({
|
|||||||
|
|
||||||
// Determine which page to query.
|
// Determine which page to query.
|
||||||
if ( -1 !== args.posts_per_page ) {
|
if ( -1 !== args.posts_per_page ) {
|
||||||
args.paged = Math.floor( this.length / args.posts_per_page ) + 1;
|
args.paged = Math.round( this.length / args.posts_per_page ) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
options.data.query = args;
|
options.data.query = args;
|
||||||
|
2
wp-includes/js/media/models.min.js
vendored
2
wp-includes/js/media/models.min.js
vendored
File diff suppressed because one or more lines are too long
@ -138,7 +138,7 @@ Query = Attachments.extend({
|
|||||||
|
|
||||||
// Determine which page to query.
|
// Determine which page to query.
|
||||||
if ( -1 !== args.posts_per_page ) {
|
if ( -1 !== args.posts_per_page ) {
|
||||||
args.paged = Math.floor( this.length / args.posts_per_page ) + 1;
|
args.paged = Math.round( this.length / args.posts_per_page ) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
options.data.query = args;
|
options.data.query = args;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-alpha-31405';
|
$wp_version = '4.2-alpha-31406';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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…
x
Reference in New Issue
Block a user