Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.3.0]: Update order status from overview gives an error #3284

Closed
WHITE-developer opened this issue Sep 28, 2023 · 4 comments
Closed

[4.3.0]: Update order status from overview gives an error #3284

WHITE-developer opened this issue Sep 28, 2023 · 4 comments
Assignees
Labels
commerce4 Issues related to Commerce v4

Comments

@WHITE-developer
Copy link

What happened?

Updating the order statuses from the order overview gives errors.

When one or more orders are selected from the overview and we select the 'Update Order Status...' button below, than we get the following error:

craft\commerce\services\OrderStatuses::getOrderStatusById(): Argument #1 ($id) must be of type int, null given, called in /var/www/html/vendor/craftcms/commerce/src/services/OrderStatuses.php on line 437

Just is case, I've disabled our modules and there are no plugins in the tracestack, so it looks like it has something to do with Commerce.

When I look at the ajax request, this is the payload:

Screenshot from 2023-09-28 14-19-15

And this is the full response:

{
    "name": "Exception",
    "message": "craft\\commerce\\services\\OrderStatuses::getOrderStatusById(): Argument #1 ($id) must be of type int, null given, called in /var/www/html/vendor/craftcms/commerce/src/services/OrderStatuses.php on line 437",
    "code": 0,
    "error": "craft\\commerce\\services\\OrderStatuses::getOrderStatusById(): Argument #1 ($id) must be of type int, null given, called in /var/www/html/vendor/craftcms/commerce/src/services/OrderStatuses.php on line 437",
    "exception": "TypeError",
    "file": "/var/www/html/vendor/craftcms/commerce/src/services/OrderStatuses.php",
    "line": 161,
    "trace": [
        {
            "file": "/var/www/html/vendor/craftcms/commerce/src/services/OrderStatuses.php",
            "line": 437,
            "function": "getOrderStatusById",
            "class": "craft\\commerce\\services\\OrderStatuses",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/commerce/src/services/OrderHistories.php",
            "line": 133,
            "function": "statusChangeHandler",
            "class": "craft\\commerce\\services\\OrderStatuses",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/commerce/src/elements/Order.php",
            "line": 3563,
            "function": "createOrderHistoryFromOrder",
            "class": "craft\\commerce\\services\\OrderHistories",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/commerce/src/elements/Order.php",
            "line": 2177,
            "function": "_saveOrderHistory",
            "class": "craft\\commerce\\elements\\Order",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/cms/src/services/Elements.php",
            "line": 3383,
            "function": "afterSave",
            "class": "craft\\commerce\\elements\\Order",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/cms/src/services/Elements.php",
            "line": 1097,
            "function": "_saveElementInternal",
            "class": "craft\\services\\Elements",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/commerce/src/elements/actions/UpdateOrderStatus.php",
            "line": 106,
            "function": "saveElement",
            "class": "craft\\services\\Elements",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/cms/src/controllers/ElementIndexesController.php",
            "line": 259,
            "function": "performAction",
            "class": "craft\\commerce\\elements\\actions\\UpdateOrderStatus",
            "type": "->"
        },
        {
            "function": "actionPerformAction",
            "class": "craft\\controllers\\ElementIndexesController",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/yiisoft/yii2/base/InlineAction.php",
            "line": 57,
            "function": "call_user_func_array"
        },
        {
            "file": "/var/www/html/vendor/yiisoft/yii2/base/Controller.php",
            "line": 178,
            "function": "runWithParams",
            "class": "yii\\base\\InlineAction",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/yiisoft/yii2/base/Module.php",
            "line": 552,
            "function": "runAction",
            "class": "yii\\base\\Controller",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
            "line": 304,
            "function": "runAction",
            "class": "yii\\base\\Module",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
            "line": 607,
            "function": "runAction",
            "class": "craft\\web\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
            "line": 283,
            "function": "_processActionRequest",
            "class": "craft\\web\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/yiisoft/yii2/base/Application.php",
            "line": 384,
            "function": "handleRequest",
            "class": "craft\\web\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/html/web/index.php",
            "line": 12,
            "function": "run",
            "class": "yii\\base\\Application",
            "type": "->"
        }
    ]
}

Craft CMS version

4.5.6

Craft Commerce version

4.3.0

PHP version

8.2

Operating system and version

Ubuntu 20.04

Database type and version

MySQL 8

Image driver and version

No response

Installed plugins and versions

@WHITE-developer WHITE-developer added commerce4 Issues related to Commerce v4 bug labels Sep 28, 2023
@bossanova808
Copy link
Contributor

Yep seeing this too

@lukeholder
Copy link
Member

I cant seem to reproduce it. Craft 4.5 latest and Commerce 4.3 latest. Screencast:

CleanShot.2023-09-30.at.08.34.17.mp4

@lukeholder lukeholder self-assigned this Sep 30, 2023
@bossanova808
Copy link
Contributor

Hmm, I updated to the latest Craft point release and things do indeed now seem ok (cms (4.5.6 => 4.5.6.1)) - so perhaps a something to do with that...or Gremlins??

Currently seems to be working ok again here, anyway

@nfourtythree
Copy link
Contributor

Thank you for updating us @bossanova808, please keep an eye on it and let us know if you can reproduce it in the future.

If so please reopen this issue and we can take a look.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commerce4 Issues related to Commerce v4
Projects
None yet
Development

No branches or pull requests

4 participants