paginagmbh / redmine_lightbox2

Lightbox for image attachments in Redmine
MIT License
126 stars 97 forks source link

CSS and JS not found (404) #85

Open masinamichele opened 3 years ago

masinamichele commented 3 years ago

Hello, I've installed this plugin (version 0.5.1) on Redmine 4.0.4. When I open an issue page, the console shows the following 404 errors: Schermata 2021-02-02 alle 14 15 51

And of course, the plugin doesn't work. Any idea on why this happens?

Thanks for any help.

tofi86 commented 3 years ago

It seems as if you didn't follow the installations instructions https://github.com/paginagmbh/redmine_lightbox2 and didn't run the "migration":

rake redmine:plugins:migrate RAILS_ENV=production

This task copies the CSS and JS assets from the plugin directory to the public directory.

masinamichele commented 3 years ago

I did run the migration. Do I need to run just rake ... or bundle exec rake ...? I tried both, but it didn't seem to work either way. I don't know if it changes something, but my Redmine installation is running in a Docker container.

Edit: If the migration task just copies the files, would I be able to copy them manually?

tofi86 commented 3 years ago

I did run the migration. Do I need to run just rake ... or bundle exec rake ...? I tried both, but it didn't seem to work either way.

Where did you run the commands?

What's the output?

I don't know if it changes something, but my Redmine installation is running in a Docker container.

I've never run this with Docker. Depending on your setup and where you run the rake task, make sure the public/ folder is accessible and writable.

Edit: If the migration task just copies the files, would I be able to copy them manually?

Sure. The content of the assets/ folder must be copied to public/plugin_assets/redmine_lightbox2/.

masinamichele commented 3 years ago

Thanks for your response. I'll update you tomorrow when I'll get back to work.

masinamichele commented 3 years ago

I manually copied the assets folder and now both the CSS and the JS are correctly loaded without any errors. Now, the plugin does work correctly on the attachments of every note. Should it work also on the issue attachments? Looking at the attachment URL, I can see it is still the default one, without the changes the plugin should apply (both on the attachment link and in the attachment preview).

Here is what I mean:

Is this the correct beheavior?


By the way, since you asked: the only output I get from the migration command is the following:

# docker exec -it redmine /bin/bash -c "rake redmine:plugins:migrate RAILS_ENV=production"
W, [2021-02-03T16:33:34.349533 #559]  WARN -- : Creating scope :system. Overwriting existing method Enumeration.system.

It's the same with both rake and bundle exec rake.