-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
[Packages] Interactivity/packages/interactivity/packages/interactivity[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
Reported by @otakupahp in #60219 (comment)
Before 6.6 I had an array with other arrays:
array(
array( 'id' => 1, 'item' => 'item 1 name' ),
array( 'id' => 1, 'item' => 'item 2 name' ),
array( 'id' => 1, 'item' => 'item 3 name' ),
);
That create this JSON:
[
{"id":1, "item":"item 1 name"},
{"id":2, "item":"item 2 name"},
{"id":3, "item":"item 3 name"},
]
The Interactive API created a context object that contains the array without problems.
Now, it just renders a string instead of an array object
To fix the error, I have to modify my array into this:
array(
'data' => array(
array( 'id' => 1, 'item' => 'item 1 name' ),
array( 'id' => 1, 'item' => 'item 2 name' ),
array( 'id' => 1, 'item' => 'item 3 name' ),
)
);
Which created this JSON:
{
"data": [
{"id":1, "item":"item 1 name"},
{"id":2, "item":"item 2 name"},
{"id":3, "item":"item 3 name"},
]
}
This is indeed parsed as an object.
Step-by-step reproduction instructions
Unknown yet, @otakupahp needs to provide more details.
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Metadata
Metadata
Assignees
Labels
[Packages] Interactivity/packages/interactivity/packages/interactivity[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended