Client invoice list says invoices were emailed on any HTTP 200

Sheernox

New Member
Env: ClientExec 7.2.2 (ionCube), PHP 8.5.10, MariaDB 11.8.9

Where: templates/default/views/billing/invoicepublic/allinvoices.phtml line 267, the success handler of the Email request (action actoninvoice, actionbutton inv-send-smart).

Bug: The handler ignores the response and shows the "invoices sent" dialog for any HTTP 200. The action answers with a JSON envelope ("success": true when it sends), but an expired session, or any request ClientExec answers with a page such as the sign-in page, also returns 200 and gets the same dialog. Nothing was emailed and the client is told it was.

Repro:
  1. Sign in as a client with an unpaid invoice and open Billing > Invoices.
  2. In another tab, sign out (or let the session expire).
  3. Back in the first tab, select the invoice, click Email and confirm. The sent dialog appears; no email is sent.
Fix: Parse the response with clientexec.parseResponse and show the dialog only when success is true; otherwise show the error message.
 
Back
Top