Clicking on the "Close window" button on the print order page has no effect.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

Works 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.

longwave’s picture

Category: bug » support

Also 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.

longwave’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No further info provided. Perhaps a theming or JavaScript issue on this particular site.

TR’s picture

Status: Closed (cannot reproduce) » Active

Actually, 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 ...

longwave’s picture

Status: Active » Needs review
FileSize
595 bytes

Forgot 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.

longwave’s picture

Improved version that doesn't rely on checking arg()

Status: Needs review » Needs work

The last submitted patch, 1822582-admin-print-invoice-6.patch, failed testing.

longwave’s picture

Unrelated 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()

longwave’s picture

Status: Needs work » Needs review

#6: 1822582-admin-print-invoice-6.patch queued for re-testing.

longwave’s picture

...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.

longwave’s picture

Sometimes the simplest patches are probably the best.

longwave’s picture

Status: Needs review » Fixed

Committed #11.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.