nextcloud / nextcloud/cookbook
Fractures are displayed with "1 0/1" instead of "1" when increasing servings
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 641
- Forks
- 113
- Avg merge
- 21h 31m
- Merged PRs (30d)
- 26
Description
Description
When the ingredients contain fractures, such as "1/2" and increasing the servings from e.g. 2 to 4 it will add up to 1 but displays "1 0/1". This works for all whole fractures, so 1 0/1, 2 0/1, 3 0/1 and so on
Reproduction
Steps to reproduce the behavior:
- Create a recipe with an ingredient with amount "1/2" e.g. "1/2 onion" and set the servings to 2
- Save the recipe
- Open the recipe and increase the servings to 4
- See the ingredients
Expected behavior
Ingredients say "1 onion"
Actual behavior
Ingredients say "1 0/1 onion"
Screenshots
1/2 (2 servings)
1 (4 servings)
Browser
Mozilla Firefox for Fedora v137.0 (64 bit)
Versions
Nextcloud server version: 31.0.2
Cookbook version: 0.11.3
Database system: MariaDB
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
Reproduce the issue with a recipe containing "1/2 onion": save it at 2 servings, increase to 4, and inspect the ingredient display in Firefox. Trace the serving-scaling and fraction-formatting path used by the recipe view; done means whole results display as "1 onion" rather than "1 0/1 onion" while fractional amounts still display correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100