ActiveStorage: Using upload_preset with folder creates invalid image links
@const-cloudinary ci sta già lavorando.
Dal 31/8/2020.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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!
- Lingua principale
- Ruby
- Stelle
- 420
- Fork
- 282
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudinary/cloudinary_gem
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
cloudinary/cloudinary_gem#597 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 52/100
cloudinary/cloudinary_gem#591 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
cloudinary/cloudinary_gem#582 · 1 commento ·
-
404's when fetching .eml files (from Action Mailbox)Forse di nuovo libera @rnamba-cloudinary l’ha presa 400 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
cloudinary/cloudinary_gem#581 · 1 commento ·
-
BlobKey, MirrorService and Sidekiq 8 are incompatibleForse di nuovo libera @const-cloudinary l’ha presa 541 giorni fa e non c’è nessuna pull request aperta. Aperta
cloudinary/cloudinary_gem#573 · 3 commenti · 1 assegnatario ·
Tutte le issue di cloudinary/cloudinary_gem
Issue simili
-
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
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
flisk-sh/flisk-labs#22 ·
-
1.severity: security
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
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
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Huerte/algo-solutions-python#260 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
internal
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Kong/developer.konghq.com#8080 ·
I maintainer di solito rispondono entro 1 giorno