nextcloud / nextcloud/cookbook

Fractures are displayed with "1 0/1" instead of "1" when increasing servings

Open
#2,745 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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:

  1. Create a recipe with an ingredient with amount "1/2" e.g. "1/2 onion" and set the servings to 2
  2. Save the recipe
  3. Open the recipe and increase the servings to 4
  4. See the ingredients

Expected behavior
Ingredients say "1 onion"

Actual behavior
Ingredients say "1 0/1 onion"

Screenshots
1/2 (2 servings)
Image
1 (4 servings)
Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.