Skip to content

Commit

Permalink
fix(link): get_input_value returns "" (#25878) (#25882)
Browse files Browse the repository at this point in the history
Steps to repro:
- Setup show title in link field
- on list view filter by that field
- Use the URL and open the page again
- filters will be erased

This is happening because:
- title->value map needs a db call to complete
- in meantime if we ask for input value we get empty value (because input is empty) and then we end up returning `""`

(cherry picked from commit fc78c06)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Apr 9, 2024
1 parent 5eea242 commit 1e70ac8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frappe/public/js/frappe/ui/filters/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ frappe.ui.filter_utils = {

let val = field.get_value() ?? field.value;

if (!val && ["Link", "Dynamic Link"].includes(field.df.fieldtype)) {
// HACK: link field with show title are async so their input value is "" but they have
// some actual value set.
val = field.value;
}

if (typeof val === "string") {
val = strip(val);
}
Expand Down

0 comments on commit 1e70ac8

Please sign in to comment.