[wp-trac] [WordPress Trac] #42760: Trying to access an attachment directly by URL not working
WordPress Trac
noreply at wordpress.org
Thu Nov 30 13:41:34 UTC 2017
#42760: Trying to access an attachment directly by URL not working
--------------------------+-----------------------------
Reporter: ppetrov2c | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.9.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
For example the URL https://example.com/wp-admin/upload.php?item=14
If there are more than 40 attachments, trying to access any attachment
page after that 40th entry, will result in a JS error:
{{{
Uncaught TypeError: Cannot read property 'set' of undefined
}}}
Trying to open any attachment page via URL before and including 40, will
work as expected.
A quick look, and it appears that, the problem comes from media-grid JS.
{{{
item = library.findWhere( { id: parseInt( query, 10 ) } );
}}}
The line above will return `undefined`, resulting in the attachment page
not showing.
I'm attaching a screenshot with a log of the `library` variable from the
media-grid JS file (line 521).
[[Image(https://i.imgur.com/euFKa0p.png)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42760>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list