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

Upload cover picture does not work when using subfolder #5631

Closed
pitaj opened this issue Apr 26, 2017 · 6 comments
Closed

Upload cover picture does not work when using subfolder #5631

pitaj opened this issue Apr 26, 2017 · 6 comments
Labels
Milestone

Comments

@pitaj
Copy link
Contributor

pitaj commented Apr 26, 2017

Uploaded cover picture path does not contain the relative_path.

@margussipria
Copy link

margussipria commented Apr 26, 2017

Please include the following information when submitting a bug report/issue:

  • NodeBB version using tags 1.4.5 (d19e59f) and 1.4.6 (fb2f857)
  • Database mongo, version 3.4.3
  • Exact steps to cause this issue
    1. Upgraded version 1.0.3 -> 1.1.2 -> 1.2.1 -> 1.3.0 -> 1.4.5 (I haven't tried clean installation)
    2. Using url with relative_path (example. /forum) ("url": "http://localhost:4567/forum")
    3. Uploading cover picture
  • What you expected
    • I expect picture be loaded from /forum/assets/uploads/profile/1-profilecover.jpeg
  • What happened instead
    • Server tries to load new pictures from /assets/uploads/profile/1-profilecover.jpeg

Thank you!

@barisusakli
Copy link
Member

@margussipria what is the value saved in the database?

@margussipria
Copy link

Now I have stated with new installation with config.json:

  {
    "url": "http://localhost:4567/bug",
    "secret": "bug",
    "database": "mongo",
    "port": "4567",
    "mongo": {
      "host": "mongo",
      "port": "27017",
      "username": "bug",
      "password": "bug",
      "database": "bug"
    }
  }

And only thing after login with new admin account I uploaded cover picture, that had same problem.

@pitaj
Copy link
Contributor Author

pitaj commented Apr 26, 2017

This is confirmed. Working on a fix.

@margussipria
Copy link

margussipria commented Apr 26, 2017

Old uploads have "cover:url" : "/forum/uploads/profile/2-profilecover" and new uploads do not have it "cover:url" : "/assets/uploads/profile/1-profilecover.jpeg".

Old profile pictures have that prefix ("picture" : "/forum/uploads/profile/2-profileimg.jpg")... and they are working... new uploads ("picture" : "/assets/uploads/profile/1-profileavatar.jpeg") do now have it and they are also working.

My question is, why does this forum not use html base when installed in subfolder

<head>
  <base href="http://localhost:4567/forum/" >
</head>

Then there is no need to prefix every resource, javascript and css, also it would be easier to include pictures from from css.

@pitaj
Copy link
Contributor Author

pitaj commented Apr 27, 2017

#5632 will fix this. The fix should ship in v1.5.0

@barisusakli barisusakli added this to the 1.5.0 milestone Apr 29, 2017
barisusakli added a commit that referenced this issue May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants