From 1a3de4bb1764ecda9fe198074c0652d5fe2584d8 Mon Sep 17 00:00:00 2001 From: Marco 'Lubber' Wienkoop Date: Sun, 20 Nov 2022 11:47:56 +0100 Subject: [PATCH] fix(api): support [] inside form names One case was not fetched in the new 2.9.0 api form serializer: When a named key has an array push in between the named key like "foo[][bar]" --- src/definitions/behaviors/api.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/definitions/behaviors/api.js b/src/definitions/behaviors/api.js index ffbb2f0f64..66a6bd8ccd 100644 --- a/src/definitions/behaviors/api.js +++ b/src/definitions/behaviors/api.js @@ -468,7 +468,9 @@ $.api = $.fn.api = function(parameters) { } else { pushValues[pushKey] = [pushValues[pushKey] , value]; } - value = pushValues[pushKey]; + if(pushKey.indexOf('[]')===-1) { + value = pushValues[pushKey]; + } while ((k = nameKeys.pop()) !== undefined) { // foo[]