Skip to main content

I have created a custom module that opens up a page in the admin overlay. Upon going to that page, a PDF is generated and the link to the file is displayed on the page. I created the link using the l() functionl(), and gave the link a target attribute of '_blank' to open in a new tab/window:.

l('Click here to download your PDF file.', $f_url, array('attributes' => array('target' => '_blank')))

The link looks like it is generated correctly:.

<a href="http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf" target="_blank">Click here to download your PDF file.</a>

But whenWhen I click on it, it opens in a new window, but somehow the overlay fragment is tacked onto the end of the URL in the new window address bar, which appears as the following: http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf#overlay-context=test.html.

http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf#overlay-context=test.html

And theThe browser throws up a dialog box with a title of "Adobe PDF Document" and a message alert of "This operation is not allowed".

If I click this link from a non overlay page, it does exactly what it's supposed to do: openOpen the PDF in a new window.

I'm not exactly sure what's going on here. How

How is the overlay fragment being appended to the URL ..., and how can I prevent it?

I have created a custom module that opens up a page in the admin overlay. Upon going to that page, a PDF is generated and the link to the file is displayed on the page. I created the link using the l() function and gave the link a target attribute of '_blank' to open in a new tab/window:

l('Click here to download your PDF file.', $f_url, array('attributes' => array('target' => '_blank')))

The link looks like it is generated correctly:

<a href="http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf" target="_blank">Click here to download your PDF file.</a>

But when I click on it, it opens in a new window, but somehow the overlay fragment is tacked onto the end of the URL in the new window address bar:

http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf#overlay-context=test.html

And the browser throws up a dialog box with a title of "Adobe PDF Document" and a message alert of "This operation is not allowed".

If I click this link from a non overlay page, it does exactly what it's supposed to do: open the PDF in a new window.

I'm not exactly sure what's going on here. How is the overlay fragment being appended to the URL ... and how can I prevent it?

I have created a custom module that opens up a page in the admin overlay. Upon going to that page, a PDF is generated and the link to the file is displayed on the page. I created the link using l(), and gave the link a target attribute of '_blank' to open in a new tab/window.

l('Click here to download your PDF file.', $f_url, array('attributes' => array('target' => '_blank')))

The link looks like it is generated correctly.

<a href="http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf" target="_blank">Click here to download your PDF file.</a>

When I click on it, it opens in a new window, but somehow the overlay fragment is tacked onto the end of the URL in the new window address bar, which appears as the following: http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf#overlay-context=test.html.

The browser throws up a dialog box with a title of "Adobe PDF Document" and a message alert of "This operation is not allowed".

If I click this link from a non overlay page, it does exactly what it's supposed to do: Open the PDF in a new window.

I'm not exactly sure what's going on here.

How is the overlay fragment being appended to the URL, and how can I prevent it?

Tweeted twitter.com/#!/StackDrupal/status/211813811269808128
Source Link
demarts
  • 67
  • 1
  • 8

How do I prevent a link on an overlay page from opening in another overlay page in Drupal 7?

I have created a custom module that opens up a page in the admin overlay. Upon going to that page, a PDF is generated and the link to the file is displayed on the page. I created the link using the l() function and gave the link a target attribute of '_blank' to open in a new tab/window:

l('Click here to download your PDF file.', $f_url, array('attributes' => array('target' => '_blank')))

The link looks like it is generated correctly:

<a href="http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf" target="_blank">Click here to download your PDF file.</a>

But when I click on it, it opens in a new window, but somehow the overlay fragment is tacked onto the end of the URL in the new window address bar:

http://xxxx.com/sites/default/files/custom-pdf/xxxx_4.pdf#overlay-context=test.html

And the browser throws up a dialog box with a title of "Adobe PDF Document" and a message alert of "This operation is not allowed".

If I click this link from a non overlay page, it does exactly what it's supposed to do: open the PDF in a new window.

I'm not exactly sure what's going on here. How is the overlay fragment being appended to the URL ... and how can I prevent it?