Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Clicking on the "Close window" button on the print order page has no effect.
Comment | File | Size | Author |
---|---|---|---|
#11 | 1822582-admin-close-invoice.patch | 544 bytes | longwave |
#6 | 1822582-admin-print-invoice-6.patch | 2.17 KB | longwave |
#5 | 1822582-admin-print-invoice.patch | 595 bytes | longwave |
print-order-close-windows-button.png | 6.36 KB | Begun |
Comments
Comment #1
longwaveWorks for me in both Firefox and Chrome, what browser are you testing with?
The code is simple - it just uses onclick="window.close();" - so it should work in all browsers, unless you have JavaScript disabled or blocking this action for some reason.
Comment #2
longwaveAlso tested this in IE, you get a popup warning you that the window is about to be closed, but there is nothing we can do about that.
Comment #3
longwaveNo further info provided. Perhaps a theming or JavaScript issue on this particular site.
Comment #4
TR CreditAttribution: TR commentedActually, what happens for me in all browsers is that the "Printable Invoice" link found in the secondary tabs at admin/store/orders/%order/invoice just takes me to admin/store/orders/%order/invoice/print in the same window that I'm already in - it *doesn't* open a pop-up. In this case, the "Close window" button can't do anything. I'm using Seven as my admin theme. I never liked that pop-up, and I think I remember the pop-up never worked in the D7 port. I never brought that up as an issue because I like it better without the pop-up. I guess we could remove the close button though.
From the image in the original post, it seems the OP doesn't get a pop-up either.
It would be interesting to know why the pop-up works for longwave, as I can't find any code that would be responsible for that ...
Comment #5
longwaveForgot there are two different ways to get to this page.
For normal users, at e.g. /user/1/orders/1 they see a link with "Click to open a window with a printable invoice". This link opens a new window with JavaScript and the button works as expected here.
For admins, there is a link at /admin/store/orders/1/invoice which does not open in a new window, so the button does not work here.
The attached patch removes the link from the admin view. Alternatively we could force the admin link to open in a new window with one of the menu alter hooks, but I think removing the button is better.
Comment #6
longwaveImproved version that doesn't rely on checking arg()
Comment #8
longwaveUnrelated fail in credit card test case
Raw "Your order is almost complete." found Other uc_store.test 153 UbercartTestHelper->checkout()
Found the Submit order button Other uc_store.test 156 UbercartTestHelper->checkout()
Comment #9
longwave#6: 1822582-admin-print-invoice-6.patch queued for re-testing.
Comment #10
longwave...but this still doesn't work if you open the invoice from the action icon in the table at /user/1/orders.
Maybe we should just remove "Close window" altogether? It's not like users don't already know how to close a popup.
Comment #11
longwaveSometimes the simplest patches are probably the best.
Comment #12
longwaveCommitted #11.