ActiveStorage: Using upload_preset with folder creates invalid image links
@const-cloudinary ya está trabajando en esto.
Desde el 31/8/2020.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Describe the bug in a sentence or two.
I use different upload presets in my app which default to a different folder each (e.g. "production").
storage.yml:
cloudinary:
service: Cloudinary
upload_preset: <%= ENV['CLOUDINARY_UPLOAD_PRESET'] %>
What the SDK cannot know is that the upload preset is configured to upload files into a specified folder. Therefore, when it generates links to the uploaded images, they miss the folder part and result in dead links.
Issue Type
[ ] Build - Can’t install or import the SDK
[ ] Performance - Performance issues
[X] Behaviour - Functions aren’t working as expected (Such as generate URL)
[ ] Documentation - Inconsistency between the docs and behaviour
[ ] Other (Specify)
Steps to reproduce
- Configure an upload preset using an upload folder (e.g. "test") in the Cloudinary administration interface.
- Configure Rails' storage.yml to use
upload_preset: testwith the configured cloudinary service (see above). - Upload a file attachment via Rails and ActiveStorage, then use url_for() to generate a link to that image.
- Observe: the link misses the "test"-folder part.
Operating System
[ ] Linux
[ ] Windows
[ ] OSX
[X] All
Environment and Libraries
Cloudinary Ruby SDK version - 1.13.2
Ruby Version - 2.6.6
Rails Version - 5.2.4.1
ActiveStorage - 5.2.4.1
Suggestion
We could use the Cloudinary API to fetch the configured upload folder for the specified upload preset. I'm not sure that's a good idea - we might end up calling the API every time someone uses an upload_prefix.
We may also introduce another storage.yml option "preset_folder" to be used together with upload_preset only.
I need this fixed quite urgently so I'm absolutely willing to submit a PR. Any hints from the maintainers would be totally helpful!
- Lenguaje dominante
- Ruby
- Estrellas
- 420
- Forks
- 282
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudinary/cloudinary_gem
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
cloudinary/cloudinary_gem#597 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 52/100
cloudinary/cloudinary_gem#591 · 3 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
cloudinary/cloudinary_gem#582 · 1 comentario ·
-
404's when fetching .eml files (from Action Mailbox)Quizá libre de nuevo @rnamba-cloudinary la tomó hace 400 días y no hay ningún pull request abierto. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
cloudinary/cloudinary_gem#581 · 1 comentario ·
-
BlobKey, MirrorService and Sidekiq 8 are incompatibleQuizá libre de nuevo @const-cloudinary la tomó hace 541 días y no hay ningún pull request abierto. Abierto
cloudinary/cloudinary_gem#573 · 3 comentarios · 1 asignado ·
Todos los issues de cloudinary/cloudinary_gem
Issues similares
-
area: ci benchmark build developer-experience difficulty: easy dx enhancement github-actions good first issue hacktoberfest help wanted performance quality rank: 8 kyu ruby tech: ruby
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
flisk-sh/flisk-labs#22 ·
-
1.severity: security
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
15-minutes 5-minutes algorithm any-language beginner-friendly c cpp csharp easy go good first issue hacktoberfest help wanted java javascript kotlin python rust swift typescript
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Huerte/algo-solutions-python#260 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
internal
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Kong/developer.konghq.com#8080 ·
Los mantenedores suelen responder en 1 día