nextcloud / nextcloud/cookbook

Fix unicode fraction conversion

Open
#2,498 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Frontend good first issue
Dominant language
HTML
Stars
641
Forks
113
Avg merge
21h 31m
Merged PRs (30d)
26

Description

Description
When using unicode fractions, the web UI reports the ingredient to not be parsable but in fact it is parsable and correctly calculated.

Reproduction
Steps to reproduce the behavior:

  1. Create or edit a recipe
  2. Add an ingredient with a unicode fraction, e.g. ¾
  3. Save and view the recipe
  4. Change the recipe yield to trigger recalculation

Expected behavior
No warning is shown to the user

Actual behavior
A warning sign is shown to the user indicating a problem with the calculation (see screenshots).

Screenshots
grafik

After changing the yield amount:
grafik

Browser
Firefox

Versions
Nextcloud server version: 30
Cookbook version: 0.11.1
Database system: MySQL


Maybe @Weissnix4711 or @j0hannesr0th, can you have a look at this? Ideally, I would say that the same Regex is used to check and to do the actual calculation to avoid such conflicts. That would mean some restructuring but should be managable.

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

Start by tracing the ingredient parsing, warning display, and recalculation paths described in the reproduction, then compare how unicode fractions are validated and calculated. Reproduce the issue with ¾ and changing the recipe yield. Done means the valid ingredient recalculates without showing a warning.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.