-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Describe the bug
The Santiy Studio has a copy-paste feature for array members. But this doesn't work for anonymous objects, as described in sanity-io/sanity#7607. And this problem occurs when trying to paste a cloudinary.asset field defined as an array member.
It seems like this could be due to some fields in the asset object are anonymous, such as: context, metadata and derived (they don't have the _type attribute)
To Reproduce
Steps to reproduce the behavior:
- Create a document schema with an array field of type
cloudinary.asset:
defineField({
type: 'array',
name: 'images',
title: 'Images',
of: [defineArrayMember({ type: 'cloudinary.asset' })],
}),- Create a new document from this schema in the studio
- Add an image in the "Images" array:
- Now copy this item
- Try and paste it in the array
- You will get the error
Value of type "object" is not allowed in this array field
Expected behavior
Pasting the item should work without any error.
Which versions of Sanity are you using?
@sanity/cli (global) 3.75.0 (up to date)
@sanity/cli 3.75.0 (up to date)
@sanity/document-internationalization 3.3.1 (up to date)
@sanity/locale-nb-no 1.1.19 (up to date)
@sanity/locale-sv-se 1.2.17 (up to date)
@sanity/ui 2.13.0 (up to date)
@sanity/vision 3.75.0 (up to date)
sanity 3.75.0 (up to date)Using "sanity-plugin-cloudinary": 1.1.5
What operating system are you using?
macOS 15.1.1
Which versions of Node.js / npm are you running?
node v22.11.0
pnpm v9.15.4
aulonm, eskil0312 and Ev1ch
Metadata
Metadata
Assignees
Labels
No labels