Opened 6 years ago
Closed 4 years ago
#50507 closed defect (bug) (worksforme)
The modal window is blank depending on the URL
| Reported by: | madeinua | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | External Libraries | Version: | 5.4.2 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: | ui, javascript |
Description
Hi there,
I found that the function tb_parseQuery() can incorrectly parse some URLs that lead to incorrect displaying of modal windows: they are empty because of the undefined parameter "inlineId".
Sample URL:
https://test.localhost/wp-admin/index.php#TB_inline?inlineId=modal_123
tb_parseQuery() of this URL returns nothing.
Should be:
Object { page: "media#TB_inline", inlineId: "modal_123" }
The solution to the problem is to change this:
var Pairs = query.split(/[;&]/);
into this
var Pairs = query.split(/[;&?]/);
Not sure if this will not break something else, but it makes the Thickbox window work.
Attachments (1)
Change History (3)
#1
@
6 years ago
Sorry, the wrong URL is:
https://test.localhost/wp-admin/options-general.php?page=media#TB_inline?inlineId=modal_123
Thanks!
#2
@
4 years ago
- Milestone Awaiting Review
- Resolution → worksforme
- Status new → closed
Hi @madeinua,
Sorry that this one took so long to receive a response.
I'm able to reproduce the issue with the URL you shared. However, I think this is happening because the URL is incorrect. There are two ?s in your URL. If you restructure the URL to use & for the two query vars, it works correctly.
In my testing, both of these work:
https://test.localhost/wp-admin/options-general.php?page=media&inlineId=modal_123#TB_inlinehttps://test.localhost/wp-admin/options-general.php#TB_inline?page=media&inlineId=modal_123
I'm going to close this out as a worksforme.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Fix file