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

CSS and JS not found (404) #85

Open
masinamichele opened this issue Feb 2, 2021 · 5 comments
Open

CSS and JS not found (404) #85

masinamichele opened this issue Feb 2, 2021 · 5 comments

Comments

@masinamichele
Copy link

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
Copy link
Collaborator

tofi86 commented Feb 2, 2021

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
Copy link
Author

masinamichele commented Feb 2, 2021

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
Copy link
Collaborator

tofi86 commented Feb 2, 2021

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
Copy link
Author

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

@masinamichele
Copy link
Author

masinamichele commented Feb 3, 2021

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:

  • Attachment on a note (works correctly)
    Schermata 2021-02-03 alle 14 04 15

  • Attachment on the issue itself (doesn't work)
    Schermata 2021-02-03 alle 14 04 47

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.

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

2 participants