Open MacLemon opened 4 years ago
@MacLemon actually, this doesn't seem feasible, as we are checking for unique recipe names, and if a recipe by the exact same name as the requested one already exists, we reject the request. Any other approach could lead to data loss.
One could argue that this particular use case could be accommodated through checking for similarities in the existing recipe, but that's more of a feature request than a bug.
As for the server error in particular, that shouldn't happen, and I'm not seeing it in the latest master branch, so it'll likely be fixed in the next update.
Summary:
When importing the same recipe again a webserver error is show to the user.
Steps to Reproduce:
Import a recipe, for example Hummus with dried tomatos. (from german Chefkoch.de).
Go to the recipe's original website and change the amount of servings, as supported by Chefkoch. For example changing from 8 servings to 4.
This changes the recipe URL to
https://www.chefkoch.de/rezepte/2409581380640280/Hummus-mit-getrockneten-Tomaten.html?portionen=4
. Notice the addedGET
paramter?portionen=4
.Copy that new URL, and import that recipe again.
Expected Results:
I'd expect the already imported recipe to get updated with the new amounts.
Reasoning: Cookbook already seems to parse the “servings” amount and also displays it. (Though probably not parsed from the URL but from the page itself.) Cookbook could determine that this is an existing recipe, because it tracks the source URL which is the same when disregarding the URL parameter.
Actual Results:
The user is presented with a webserver error message in a pop over. (nginx in my case).
The recipe does not get updated with new amounts (as per the
?portionen=4
parameter ). User isn't asked to import the same recipe as a duplicate.I am that system administrator. :-)
Regression:
n/a
Notes:
When in doubt, use more garlic to spice things up!
Version Information:
Nextcloud Hub 18.0.3 Cookbook 0.6.3 Webserver: nginx 1.17.9 PHP: PHP 7.3.16 Browser: Firefox 75.0 on macOS Mojave.
Nextcloud Log output