-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
area: extensions/media-librariesarea: media-librarytype: bugcode to address defects in shipped codecode to address defects in shipped code
Description
Describe 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
Metadata
Metadata
Assignees
Labels
area: extensions/media-librariesarea: media-librarytype: bugcode to address defects in shipped codecode to address defects in shipped code