Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions/ingredients not shown in editing view #1210

Closed
prometheus42 opened this issue Sep 18, 2022 · 3 comments · Fixed by #1222
Closed

Instructions/ingredients not shown in editing view #1210

prometheus42 opened this issue Sep 18, 2022 · 3 comments · Fixed by #1222
Labels
Backend Issue or PR related to the backend code bug Something isn't working php Pull requests that update Php code

Comments

@prometheus42
Copy link

Description
Many of my recipes were converted from other formats into JSON. Sometimes they contain empty lines in the instructions or the ingredients. When viewing a recipe, the empty entries are ignored, but all instructions/ingredients are shown correctly. But in the editing view no input field is shown for any of the instructions/ingredients.

Reproduction
Steps to reproduce the behavior:

  1. Add recipe to your collection: recipe.json.txt
  2. Update recipe collection.
  3. Open recipe.
  4. Click on edit button to open editing view.

Expected behavior
All instructions and ingredients should be shown.

Actual behavior
No instructions and ingredients are shown.

Browser
Vivaldi 5.4.2753.51 (Stable channel) stable (64-Bit)

Versions
Nextcloud server version: 23.0.9
Cookbook version: 0.9.15
Database system: MariaDB

@prometheus42 prometheus42 added the bug Something isn't working label Sep 18, 2022
@christianlupus christianlupus added javascript Pull requests that update Javascript code Frontend Issue or PR related to the frontend code labels Sep 22, 2022
@christianlupus
Copy link
Collaborator

I checked with my browser and there is a problem with the js code. There are some problems within Vue. Further debugging is required.

@christianlupus christianlupus added php Pull requests that update Php code Backend Issue or PR related to the backend code and removed javascript Pull requests that update Javascript code Frontend Issue or PR related to the frontend code labels Sep 23, 2022
@christianlupus
Copy link
Collaborator

I have to revert my statement. The problem lies in a bad data format that is generated by the backend. This is caused by the filters that remove the empty lines.

The problem is that the filter is used on output as well. Thus, in PHP an array with a missing index is generated. This cannot be translated to JSON directly (JS arrays are contiguous) but are translated into a JS object:
grafik

christianlupus added a commit that referenced this issue Sep 23, 2022
Signed-off-by: Christian Wolf <github@christianwolf.email>
christianlupus added a commit that referenced this issue Sep 23, 2022
Signed-off-by: Christian Wolf <github@christianwolf.email>
@christianlupus christianlupus added this to the Release 0.9.16 milestone Sep 23, 2022
@prometheus42
Copy link
Author

Thank you! That was a really fast fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Issue or PR related to the backend code bug Something isn't working php Pull requests that update Php code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants