File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 6262 var searchText = ' ' ;
6363 try {
6464 var autofill_attributes = JSON .parse (@json ($request -> input (' autofill_attributes' ) ));
65- searchText = autofill_attributes .map (function (attr ) {
66- let input = $ (modalId + " [name='" + attr + " ']" ).serializeArray ()[0 ];
67- return input ? input[' value' ] : ' ' ;
68- }).join (' ' );
65+ if (Array .isArray (autofill_attributes)) {
66+ searchText = autofill_attributes .map (function (attr ) {
67+ let input = $ (modalId + " [name='" + attr + " ']" ).serializeArray ()[0 ];
68+ return input ? input[' value' ] : ' ' ;
69+ }).join (' ' );
70+ } else {
71+ let input = $ (modalId + " [name='" + autofill_attributes + " ']" ).serializeArray ()[0 ];
72+ if (input) {
73+ searchText = input[' value' ];
74+ }
75+ }
6976 } catch (e) {
7077 let input = $ (modalId + " [name='{{ $request -> input (' autofill_attributes' ) } } ']" ).serializeArray ()[0 ];
7178 if (input) {
You can’t perform that action at this time.
0 commit comments