Cloudinary using a string value instead of an array when selecting a single image
See original GitHub issueDescribe the bug This issue is the same as the one described here #2573
When selecting 2 images via Cloudinary media_library, the image strings are saved in markdown as an array. When selecting 1 image, it is saved in markdown as a string.
To Reproduce
- Use the following configuration
backend:
name: git-gateway
branch: master
local_backend: true
media_library:
name: cloudinary
config:
cloud_name: #REPLACE-THIS
api_key: #REPLACE-THIS
media_folder: static/img
public_folder: /img
collections:
- name: "items"
editor:
preview: false
label: "items"
folder: "content/items"
create: true
slug: "{{slug}}"
fields:
- { label: "Name", name: "title", widget: "string" }
- label: "multiple images"
name: "images"
widget: "image"
media_library:
config:
multiple: true
- Create a new item with two images
- Create a new item with a single image
- You should have 2 new files
---
title: One
images:
- https://res.cloudinary.com/chromjs/image/upload/v1623377465/laptop1_xzo5ac.jpg
- https://res.cloudinary.com/chromjs/image/upload/v1623194500/sample.jpg
---
---
title: Two
images: https://res.cloudinary.com/chromjs/image/upload/v1623377465/laptop1_xzo5ac.jpg
---
Expected behavior Item “Two” should be an array of a single item
I created a repo with the minimal configuration: https://github.com/chromjs/cloudinary_array_issue
Applicable Versions:
"gatsby": "^3.13.0",
"gatsby-plugin-netlify-cms": "^5.13.0",
"netlify-cms-app": "^2.15.44",
"netlify-cms-media-library-cloudinary": "^1.3.10",
"react": "^17.0.1",
"react-dom": "^17.0.1"
CMS configuration
backend:
name: git-gateway
branch: master
local_backend: true
media_library:
name: cloudinary
config:
cloud_name: #REPLACE-THIS
api_key: #REPLACE-THIS
media_folder: static/img
public_folder: /img
collections:
- name: "items"
editor:
preview: false
label: "items"
folder: "content/items"
create: true
slug: "{{slug}}"
fields:
- { label: "Name", name: "title", widget: "string" }
- label: "multiple images"
name: "images"
widget: "image"
media_library:
config:
multiple: true
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Programmatically Uploading Images, Videos, and Other Files
You can either upload using Cloudinary's REST API or one of Cloudinary's client libraries (SDKs), which wrap the upload API and simplify ...
Read more >Advanced URL Options for Media Asset Delivery - Cloudinary
Learn about Cloudinary's advanced URL options for delivering your media assets, such as special CDN options, placeholders and delivery URL ...
Read more >Image Transformations for Developers - Cloudinary
Learn how to dynamically transform images with one line of code: crop, resize, ... using a user-defined variable for the text string value....
Read more >Upload API Reference - Cloudinary
For example, you can use the following SDK command to create an image asset saved to your Cloudinary product environment from a string...
Read more >Upload Widget API reference - Cloudinary
searchBySites, Array of strings, The URLs of sites to allow for Image Search. If more than one site is given, the Search by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @deepto98, I think @mtfoley shared the current code location to get you started.
Also see our contribution guide here https://github.com/netlify/netlify-cms/blob/master/CONTRIBUTING.md
Hi @erezrokah, Can I help you with this issue?