Feature: #838 - Protect status changes and keep an order history
See Issue 838
Description
The payment and the shipping status in the order details of the backend
module are changed by the new
\Extcode\:
- Only registered status are accepted.
- The form sends the status it showed. If the order has another status in the meantime, e.g. changed in another tab, nothing is changed and a flash message tells the editor.
- Submitting the current status changes nothing.
- The status is updated atomically, so of several requests with the same expected status only one changes it.
Every change is written to the new table tx_
with the old and the new value, the date, the source (backend, frontend, API
or command line), the backend user, if there is one, and an optional
initiator, e.g. a payment provider. The order details of the backend module show these
changes as order history. The table is generic, other changes of an order can
be written to it as well. The command order: removes the order
history of the orders it deletes.
See Change the status.
Impact
Run the database analyzer to create the table
tx_.
The structure of the order history may still change in minor versions. If a
change cannot be migrated, the existing entries of
tx_ may have to be removed.
The forms of the payment and the shipping status in
Resources/ send the
fields status and from and pass the payment or the shipping as
argument of the action. Overridden partials have to be adapted.
\Extcode\ and
\Extcode\ extend the new
Abstract and get the Status injected
instead of the repositories. The event
\Extcode\ is only dispatched if the
status was changed.
The backend and the frontend Order get the
Order (the backend one also the Order)
injected by the constructor instead of an inject method. Subclasses which
override the constructor have to be adapted.