ai-admin-jsonadm icon indicating copy to clipboard operation
ai-admin-jsonadm copied to clipboard

Order:status() internaltype metadata

Open exemplari opened this issue 3 years ago • 3 comments
trafficstars

curl -b cookies.txt -c cookies.txt
-X OPTIONS 'https://localhost:8000/admin/default/jsonadm'

Expected Attributes > $attr > internaltype , to be an integer eg) 2 or "null".

For order:status() it is a string of "2".


"order.editor": {
                "code": "order.editor",
                "type": "string",
                "label": "Editor",
                "public": false,
                "default": null,
                "required": true,
                "internalcode": "mord.\"editor\"",
                "internaldeps": [],
                "internaltype": 4
            },
            "order:status()": {
                "code": "order:status()",
                "type": "integer",
                "label": "Number of order status items, parameter(<type>,<value>)",
                "public": false,
                "default": null,
                "required": true,
                "internalcode": "( SELECT COUNT(mordst_cs.\"parentid\")\n\t\t\t\tFROM \"mshop_order_status\" AS mordst_cs\n\t\t\t\tWHERE mord.\"id\" = mordst_cs.\"parentid\" AND ( mordst_cs.\"siteid\" IN ('','1.') )\n\t\t\t\tAND mordst_cs.\"type\" = $1 AND mordst_cs.\"value\" IN ( $2 ) )",
                "internaldeps": [],
                "internaltype": "2"
            },

exemplari avatar May 10 '22 01:05 exemplari

No clue why it's encoded as string. The constant in the manager is the same as for all others: https://github.com/aimeos/aimeos-core/blob/master/src/MShop/Order/Manager/Standard.php#L163

aimeos avatar May 10 '22 02:05 aimeos

this line change only order:status, not sure what its for https://github.com/aimeos/aimeos-core/blob/cef4d5d5b45bc9a2a92ad9c110369447fb35b39c/src/MShop/Order/Manager/Standard.php#L184

exemplari avatar May 10 '22 09:05 exemplari

That might be the source of the problem because str_replace() is performed over all array properties including the internaltype. Changed in dev-master, 2022.04.x-dev and 2021.10.x-dev. Can you check if it's now correct?

aimeos avatar May 10 '22 10:05 aimeos