You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shopping list counts a recipe twice when three or more menus reference each other in a ring #810
On the web shopping list, menus that reference each other in a ring of three or more count a recipe twice.
To reproduce, with Rice.cook, Beans.cook and Corn.cook (100 g each):
A.menu: - @./Rice{} and - @./B.menu{}
B.menu: - @./Beans{} and - @./C.menu{}
C.menu: - @./Corn{} and - @./A.menu{}
Add A.menu to the shopping list and open it: rice shows 200 g, beans and corn 100 g. cook shopping-list A.menu gives 100 g of each, with a warning naming the cycle. A ring of two (A ↔ B) is counted correctly.
Why: add_menu stores A's meals as entries of their own, B among them, with the references B follows (Beans, C.menu). The page then expands each entry on its own. add_menu drops a reference of B straight back to A (the two-menu case, from #609), but here B reaches A through C. B's expansion goes on into A, whose recipes are already on the list, and core's cycle check only stops when the chain comes back to B. Dropping C.menu from B's entry instead would lose the corn.
Since menus could be meals of each other, d99192b (#609).
Activity