Skip to content

[5.x]: Trying to 'replace' tag results in HTTP 400 Error #16310

@roberttolton

Description

@roberttolton

What happened?

Description

When trying to replace a tag using the 'replace' button, the modal opens but an error is reported in the Network console.

Steps to reproduce

  1. Create an entry with a 'Tags' field that has a configured source.
  2. After the entry is saved, try and replace the tag.

Expected behavior

Tag should be replaced via modal.

Actual behavior

Modal appears but the loading indicator never disappears. In the Network console you can see a HTTP 400 error:

{
    "name": "Bad Request",
    "message": "Request missing required param",
    "code": 0,
    "status": 400,
    "exception": "yii\\web\\BadRequestHttpException",
    "file": "/app/vendor/craftcms/cms/src/web/Request.php",
    "line": 1115,
    "trace": [
        {
            "file": "/app/vendor/craftcms/cms/src/controllers/BaseElementsController.php",
            "line": 48,
            "function": "getRequiredParam",
            "class": "craft\\web\\Request",
            "type": "->"
        },
        {
            "file": "/app/vendor/craftcms/cms/src/controllers/ElementSelectorModalsController.php",
            "line": 31,
            "function": "elementType",
            "class": "craft\\controllers\\BaseElementsController",
            "type": "->"
        },
        {
            "function": "actionBody",
            "class": "craft\\controllers\\ElementSelectorModalsController",
            "type": "->"
        },
        {
            "file": "/app/vendor/yiisoft/yii2/base/InlineAction.php",
            "line": 57,
            "function": "call_user_func_array"
        },
        {
            "file": "/app/vendor/yiisoft/yii2/base/Controller.php",
            "line": 178,
            "function": "runWithParams",
            "class": "yii\\base\\InlineAction",
            "type": "->"
        },
        {
            "file": "/app/vendor/yiisoft/yii2/base/Module.php",
            "line": 552,
            "function": "runAction",
            "class": "yii\\base\\Controller",
            "type": "->"
        },
        {
            "file": "/app/vendor/craftcms/cms/src/web/Application.php",
            "line": 350,
            "function": "runAction",
            "class": "yii\\base\\Module",
            "type": "->"
        },
        {
            "file": "/app/vendor/craftcms/cms/src/web/Application.php",
            "line": 649,
            "function": "runAction",
            "class": "craft\\web\\Application",
            "type": "->"
        },
        {
            "file": "/app/vendor/craftcms/cms/src/web/Application.php",
            "line": 312,
            "function": "_processActionRequest",
            "class": "craft\\web\\Application",
            "type": "->"
        },
        {
            "file": "/app/vendor/yiisoft/yii2/base/Application.php",
            "line": 384,
            "function": "handleRequest",
            "class": "craft\\web\\Application",
            "type": "->"
        },
        {
            "file": "/app/web/index.php",
            "line": 12,
            "function": "run",
            "class": "yii\\base\\Application",
            "type": "->"
        }
    ]
}

Payload given was:

{"context":"modal","elementType":null,"sources":null,"showSiteMenu":"0"}

Perhaps elementType and/or sources should not be NULL?

Craft CMS version

5.5.6

PHP version

8.2

Operating system and version

macOS & Docker Ubuntu

Database type and version

MySQL 8

Image driver and version

No response

Installed plugins and versions

  • Commerce v5.x

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions