mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@31406 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1230,7 +1230,7 @@ Query = Attachments.extend({
|
||||
|
||||
// Determine which page to query.
|
||||
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;
|
||||
|
||||
@@ -138,7 +138,7 @@ Query = Attachments.extend({
|
||||
|
||||
// Determine which page to query.
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user