ActiveStorage: Using upload_preset with folder creates invalid image links
@const-cloudinary がすでに取り組んでいます。
2020年8月31日 から。
評価
この issue はまだ評価されていません。
説明
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!
- 主要言語
- Ruby
- スター
- 420
- フォーク
- 282
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudinary/cloudinary_gem のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
cloudinary/cloudinary_gem#597 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
cloudinary/cloudinary_gem#591 · コメント 3 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cloudinary/cloudinary_gem#582 · コメント 1 件 ·
-
404's when fetching .eml files (from Action Mailbox)再び着手できるかも @rnamba-cloudinary が 400 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
cloudinary/cloudinary_gem#581 · コメント 1 件 ·
-
BlobKey, MirrorService and Sidekiq 8 are incompatible再び着手できるかも @const-cloudinary が 541 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
cloudinary/cloudinary_gem#573 · コメント 3 件 · 担当者 1 名 ·
cloudinary/cloudinary_gem の issue をすべて見る
似ている issue
-
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
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
flisk-sh/flisk-labs#22 ·
-
1.severity: security
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
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
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
Huerte/algo-solutions-python#260 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
internal
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Kong/developer.konghq.com#8080 ·
メンテナーはふだん 1 日以内に返信