Fixed addnewproduct productpicker flow shopping list selection on return (fixes #1646)

This commit is contained in:
Bernd Bestel 2021-11-08 22:09:48 +01:00
parent 286351b6d2
commit 787c885ccf
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 7 additions and 0 deletions

View File

@ -3,3 +3,4 @@
- Fixed that the "Stay logged in permanently" checkbox on the login page had no effect (thanks @0)
- Fixed that the labels of context-/more-menu items were not readable in Night Mode (thanks @corbolais)
- Fixed that auto night mode over midnight did not always work
- Fixed that the "Add as new product" productpicker workflow, started from the shopping list item form, always selected the default shopping list after finishing the flow

View File

@ -208,6 +208,12 @@ $('#product_id_text_input').on('blur', function(e)
className: 'btn-success add-new-product-dialog-button responsive-button ' + addProductWorkflowsAdditionalCssClasses,
callback: function()
{
// Not the best place here - this is only relevant when this flow is started from the shopping list item form
// (to select the correct shopping list on return)
if (GetUriParam("list") !== undefined)
{
embedded += "&list=" + GetUriParam("list");
}
Grocy.Components.ProductPicker.PopupOpen = false;
window.location.href = U('/product/new?flow=InplaceNewProductWithName&name=' + encodeURIComponent(input) + '&returnto=' + encodeURIComponent(Grocy.CurrentUrlRelative + "?flow=InplaceNewProductWithName&" + embedded) + "&" + embedded);