Skip to content

Some edit pages using Vizy throw several 400s trying to call elements/update-field-layout endpoint #349

@BenParizek

Description

@BenParizek

Describe the bug

I've just noticed this and can see the issue going back over 10 months in our logs, so not sure this if this is new or expected. But as it's an error it feels worthy of reporting.

In some cases, Vizy seems to store it's data referencing blocks via "new1", "new2", etc. On these pages, when we load the edit page we see several errors in the console where something tries to process that and call:

index.php/cms/actions/elements/update-field-layout?v=1749261035375

And Craft returns a 400 and the error:

{
    "name": "Bad Request",
    "message": "Invalid element UUID: new1",
    "code": 0,
    "status": 400,
    "exception": "yii\\web\\BadRequestHttpException",
    "file": "/var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php",
    "line": 2512,
    "trace": [
        {
            "file": "/var/www/html/vendor/craftcms/cms/src/controllers/ElementsController.php",
            "line": 2227,
            "function": "_element",
            "class": "craft\\controllers\\ElementsController",
            "type": "->"
        },
        {
            "function": "actionUpdateFieldLayout",
            "class": "craft\\controllers\\ElementsController",
            "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": 361,
            "function": "runAction",
            "class": "yii\\base\\Module",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
            "line": 660,
            "function": "runAction",
            "class": "craft\\web\\Application",
            "type": "->"
        },
        {
            "file": "/var/www/html/vendor/craftcms/cms/src/web/Application.php",
            "line": 323,
            "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": "->"
        }
    ]
}

It's a pretty generic stack trace but if I enable x-debug, I see vizyData being passed to the ElementController method that is throwing the error.

If there are multiple newX references in the JSON, we see the error multiple times. As we've been seeing this issue appear in the logs for 10 months, I'm not sure if it's causing other issues but I currently have some other edit page issue I'm looking into and discovered this and as I can't explain it or even recreate getting the newX values saved into the database in a handful of tests, I thought I'd report it and see if you can explain what's going on here and if there is any way to avoid this error.

Steps to reproduce

I don't really know.

Craft CMS version

5.7.8.1

Plugin version

3.0.9

Multi-site?

No

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions