Skip to content

[Issue] Cannot update Order status in 2.4.7 #38659

Closed
@Nuranto

Description

@Nuranto

Preconditions and environment

  • Magento version 2.4.7

Steps to reproduce

  1. Try to update status from admin order page view

Expected result

Status updated

Actual result

Status not updated

Additional information

I don't understand this change introduced in 2.4.7 :
#36562

private function getOrderStatus(string $orderStatus, string $historyStatus): string
    {
        return ($orderStatus === Order::STATE_PROCESSING || $orderStatus === Order::STATUS_FRAUD) ? $historyStatus
            : $orderStatus;
    }

Why would we be able to change status only if current status is processing or fraud ? (Also, Order::STATE_PROCESSING instead of Order::STATUS_PROCESSING )

If I understand correctly the issue #36562, the fix should be something like this instead :

private function getOrderStatus(OrderInterface $order, string $historyStatus): string
    {
        $statuses = $this->orderConfig->getStateStatuses($order->getState());
        
        if (!in_array($status, array_keys($statuses))) {
            return $order->getStatus();
        }
        return $historyStatus;
    }

Or am I missing something ?

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Area: OrderComponent: order statusIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.7Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions