fix: treat URL with only custom fields as valid in ?fields= mode
Consider visible custom fields in compute_final_field_selection so that a link with only custom_field_X is not wrongly treated as invalid and reverted to session/global. Add test for URL containing only custom field.
This commit is contained in:
parent
d5df2338a7
commit
10ad32eb6f
2 changed files with 15 additions and 2 deletions
|
|
@ -821,9 +821,10 @@ defmodule MvWeb.MemberLive.Index do
|
|||
only_url =
|
||||
FieldVisibility.selection_from_url_only(url_selection, socket.assigns.all_custom_fields)
|
||||
|
||||
visible = FieldVisibility.get_visible_member_fields(only_url)
|
||||
visible_members = FieldVisibility.get_visible_member_fields(only_url)
|
||||
visible_custom = FieldVisibility.get_visible_custom_fields(only_url)
|
||||
|
||||
if visible == [] do
|
||||
if visible_members == [] and visible_custom == [] do
|
||||
# URL had only invalid field names; fall back to session + global.
|
||||
compute_final_field_selection(false, url_selection, socket)
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue