JSONAPI format values

Created on 9 October 2023, over 1 year ago
Updated 17 October 2023, over 1 year ago

Problem/Motivation

Hi,

I've a problem since I've updated module from 1.7 to 2.0 (D9) and a custom call to create/edit node. When I try to edit (PATCH) a node, I get this error:
TypeError: substr(): Argument #1 ($string) must be of type string, array given in substr() (line 995 of /var/www/html/web/modules/contrib/metatag/metatag.module)

Steps to reproduce

This is my data body I sent (PATCH)

{
    "data": {
        "type": "node--content",
        "id": "uuid",
        "attributes": {
            "title": "Node title",
            "field_content_metatag": {
                "value": {
                    "title": "customTitle",
                    "og_title": "customOgTitle"
                }
            }
        }
    }
}

When I go into "metatag.module". I see this new function "metatag_data_decode($string)" and I think there is the problem. I send a JSON format and not a string like "a:2:{s:5:\"title\";s:4:\"test\";s:8:\"og_title\";s:4:\"test\";}"

A solution already offered via a patch or update?

πŸ› Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024