Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not see old images when upgrade Refinerycms #3478

Open
ttmthanh opened this issue Jun 25, 2020 · 3 comments
Open

Can not see old images when upgrade Refinerycms #3478

ttmthanh opened this issue Jun 25, 2020 · 3 comments

Comments

@ttmthanh
Copy link

ttmthanh commented Jun 25, 2020

After I upgrade Rails and Refinerycms refinerycms (3.0.0) (branch master) --> refinerycms (4.0.3) (branch 4-0 stable). I can not see old images before I upgrade, although amazons3 link present.

Here my images tab, new images are okay but old images can not show

ảnh

Please help me fix it, here my refinerycms gem file

gem 'refinerycms', github: 'refinery/refinerycms', branch: '4-0-stable'

gem 'refinerycms-acts-as-indexed', ['~> 3.0', '>= 3.0.0']

gem 'refinerycms-inquiries', git: 'https://github.com/refinery/refinerycms-inquiries', branch: 'master'

gem 'refinerycms-page-images', git: 'https://github.com/refinery/refinerycms-page-images', branch: 'master'

gem 'refinerycms-i18n', '~> 4.0'

gem 'refinerycms-authentication-devise', git: 'https://github.com/refinery/refinerycms-authentication-devise', branch: 'master'

gem 'refinerycms-wymeditor', ['~> 2.0', '>= 2.0.0']
@evenreven
Copy link
Contributor

evenreven commented Jun 25, 2020

I'm not sure since our setups are different (I don't use s3, for instance) and I can't remember what it looked like inside Refinery. But after upgrading from 2.1.5 to 4.0.3, all our old images and file links 404'd. In our case it was due to a change in how the Dragonfly config is handled. The default had changed.

I had to change these files:

1: config/initializers/refinery/images.rb:

`config.dragonfly_url_format = "/system/images/:job/:basename.:ext"

This depends on what the path to your old images was:

2: config/initializers/refinery/resources.rb

config.dragonfly_url_format = "/system/resources/:job/:basename.:ext"

Again, it depends on what your old paths were.

3: config/initializers/refinery/dragonfly.rb

config.verify_urls = false

I would have loved to keep this on, but since I had so many pages with links added to the body text that would have to be manually edited, I had to set it to false.

It's not necessarily the same issue, but thought I'd share.

@marcelino056
Copy link

i have the same issue, and @evenreven recommendations works, but now new images are not working.

@Matho
Copy link
Contributor

Matho commented Aug 8, 2023

Hi @marcelino056

I have checked old commits in my old refinery project. It is few years ago, when I did the commit, but I think it was working.

In my project I dont have config/initializers/refinery/dragonfly.rb file, instead I used the config.dragonfly_verify_urls = false for the images/resources initializers

Give it a try similar to this:

config/initializers/refinery/images.rb

Refinery::Images.configure do |config|
   # a lot of commented lines here ...
   config.dragonfly_verify_urls = false
   config.dragonfly_url_format = "/system/images/:job/:basename.:ext"
end

and

config/initializers/refinery/resources.rb

Refinery::Resources.configure do |config|
  # Configures the maximum allowed upload size (in bytes) for a file upload
  config.max_file_size = 1502428800

  # a lot of commented lines here

  config.dragonfly_verify_urls = false
 
  config.dragonfly_url_format = "/system/resources/:job/:basename.:format"
end

Let me know, if this fix fixed your issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants