Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to paste copied cloudinary.asset as an array member in Sanity Studio #85

Open
oscarcarlstrom opened this issue Feb 14, 2025 · 0 comments

Comments

@oscarcarlstrom
Copy link

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:

  1. Create a document schema with an array field of type cloudinary.asset:
    defineField({
      type: 'array',
      name: 'images',
      title: 'Images',
      of: [defineArrayMember({ type: 'cloudinary.asset' })],
    }),
  1. Create a new document from this schema in the studio
  2. Add an image in the "Images" array:
Image
  1. Now copy this item
Image
  1. Try and paste it in the array
Image
  1. You will get the error Value of type "object" is not allowed in this array field
Image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant