openlibhums / openlibhums/janeway
Fallbacks for news item images do not work in path mode
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 238
- Forks
- 97
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 8
Description
Describe the bug
When you use path mode, the fallback system for news item images does not work, because the journal code gets added to the path, but the media files are stored at a higher level so that NGINX can serve them.
Janeway version
1.5.0
To Reproduce
Steps to reproduce the behavior:
- Set a live journal to path mode
- Load images into the journal's default large image and default cover image
- Create a news item without a dedicated image
- Check the news item and see that the fallbacks are not loading. Example: https://olhbeta.janeway.systems/test/news/8/
- Note that the error does not appear locally as this URL provides the path during development and testing: https://github.com/BirkbeckCTP/janeway/blob/master/src/core/urls.py#L33
Context
A likely culprit is the logic set up by this function:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the fallback-related function in src/comms/models.py at lines 94-124, then compare its path handling with src/core/urls.py around line 33. Reproduce the issue with a journal in path mode, default large and cover images, and a news item without its own image. Done means both fallback images load for the news item in path mode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100