Description
Description
As reported on matrix not specifying the size query param on the /api/v1/recipes/{id}/image
endpoint will return the fallback fork and knife svg image.
Reproduction
Steps to reproduce the behavior:
- Go to
https://cloud.domain.tld/apps/cookbook/webapp/recipes/10203181/image
- see the fork and knfe Icon
- bee mad that you suspected a bug in your code and spent too much in debugging xD
Expected behavior
As mentioned on matrix by @christianlupus:
The default (without parameter) should be the full image. If no image is present, the fallback should be presented.
Actual behavior
I get the fallback image
Browser
Firefox 108.0.2-arch
Versions
Nextcloud server version: Nextcloud Hub 3 (25.0.2)
Cookbook version: 0.10.1
Database system: MySQL
Notes*
My php is too rusty and I didn't find anything with a few quick searches but the size will default to null,
and here it'll default to thumb
:
cookbook/lib/Service/RecipeService.php
Line 557 in 3bad32d
In dart the default parameter of a function will only be used when not specified i.e. something like overloading.
This would mean as the footprint of the function called is getRecipeImageFileByFolderId(12345678, null)
it won't even trigger the overloaded function.
The best thing would be to specify thumb
as the default in the first place (or full
as mentioned on matrix)