Number of categories differs between the GUI and the API
Description
The total count of categories presented in the GUI significantly varies when compared to what is available through the API.
Reproduction Steps to reproduce the behavior:
- Add many recipes
- Compare the numbers
Expected behavior The numbers should be the same.
Actual behavior The numbers are different. The numbers shown in the GUI are correct. The API numbers are wrong.
Screenshots
API
[
{
"name": "Asia",
"recipe_count": 18
},
{
"name": "Beilagen",
"recipe_count": 12
},
{
"name": "Braten",
"recipe_count": 2
},
{
"name": "Brotzeit",
"recipe_count": 6
},
{
"name": "Cocktails",
"recipe_count": 2
},
{
"name": "Dessert",
"recipe_count": 42
},
{
"name": "Dünsten",
"recipe_count": 2
},
{
"name": "Eis",
"recipe_count": 8
},
{
"name": "Fisch",
"recipe_count": 26
},
{
"name": "Fleisch",
"recipe_count": 28
},
{
"name": "Gebäck",
"recipe_count": 12
},
{
"name": "Gemüse",
"recipe_count": 2
},
{
"name": "Getränke",
"recipe_count": 6
},
{
"name": "Grillen",
"recipe_count": 24
},
{
"name": "Hauptgericht",
"recipe_count": 40
},
{
"name": "Kuchen",
"recipe_count": 55
},
{
"name": "Muffins",
"recipe_count": 14
},
{
"name": "Salate",
"recipe_count": 20
},
{
"name": "Schnelle Küche",
"recipe_count": 2
},
{
"name": "Soße",
"recipe_count": 2
},
{
"name": "Suppe",
"recipe_count": 8
},
{
"name": "Torten",
"recipe_count": 38
},
{
"name": "Veggie",
"recipe_count": 14
},
{
"name": "Vorspeise",
"recipe_count": 12
},
{
"name": "*",
"recipe_count": 1
}
]
GUI
Browser Chrome 123.0
Versions Nextcloud server version: 28.0.3 Cookbook version: 0.11.0 Database system: MariaDB
Hello I also have this bug.
Number differrent between the app cookbook and the nextcloud GUI.
It seem's the error is in NC ans not the API / app IOS.
The picture show a number to19 in todo and we can count only 16 receip
Browser Firefox
Versions Nextcloud server version: 29.0.6 Cookbook version: 0.11.1
OK, this sounds strange lik the DB had some broken entries. I have multiple ideas how to proceed here:
- Can anyone share their set of recipes (just zip the recipes folder in files app) here where the problem exists? I would like to import and see if I can reproduce.
- Do you have (direct) DB access? Then, we could have a look at the tables which indicate the categories. I can give/build the SQL commands to get more information if anyone is capable to execute these directly.
This evening I can zip the directory reciepe and send it to you (but it is 160 Mb befor zip) And it is also possible for me to be in command line on the server with the possibility to log in maria DB, but my knowledge in SQL are very tiny ;-)
Hello The zip zile is 160Mb... And download is possible there : https://nextcloud.schugart.net/s/M986rRaiJsYL2re
I tried downloading the zip file but it seems broken... I have a MD5 of 7acecec7ec0458d205d402012e9983cc. Is this true? Can you please check if the file can be unzipped by you?
Sorry the file was indeed broken (it had only 50Mb and not the 160,5Mb) Know it should works I have tested the download and unzip and it is Ok
Hmm, with the latest NC 31 (dev) version and the master branch, I cannot reproduce the problem. I put all 164 recipes (thanks for sharing :wink:) into the instance and it detected all. The categories are assigned correctly.
I am still thinking on what the problem might be. I am considering some weird effect that the import just got broken in some way and the updating algorithm is written such that existing recipes are not readded once in the database cache. There are ways to solve this but I want to avoid big changed that are to be thrown away soon...
NC30 is already available (for stable branch)? Did not sdee it... -> I will update
I was wondering if this behaviour is not because I use a "non standard way" to clone some reciepe... For example I add a cake with raspberry, and I want to change raspberry with peach. so I copy / paste in the file file browser. Change the name of the directory and edit the "new" receip with NC Cookbook app. This behavior had maybe put a strange thing in the database if it see once the same ID in the Json?
In any case this behaviour is not a problem for me :-) As soon as you get many reciepe you stop counting them ...