|
12 | 12 | instructions: "What this field will be called in the control panel."|t('app'), |
13 | 13 | id: 'name', |
14 | 14 | name: 'name', |
15 | | - value: field.name, |
| 15 | + value: old('name', field.name), |
16 | 16 | required: true, |
17 | 17 | autofocus: true, |
18 | | - errors: field.errors.get('name'), |
| 18 | + errors: errors.get('name'), |
19 | 19 | data: {'error-key': 'name'}, |
20 | 20 | disabled: readOnly, |
21 | 21 | }) }} |
|
29 | 29 | autocorrect: false, |
30 | 30 | autocapitalize: false, |
31 | 31 | maxlength: 64, |
32 | | - value: field.handle, |
| 32 | + value: old('handle', field.handle), |
33 | 33 | required: true, |
34 | | - errors: field.errors.get('handle'), |
| 34 | + errors: errors.get('handle'), |
35 | 35 | data: {'error-key': 'handle'}, |
36 | 36 | disabled: readOnly, |
37 | 37 | }) }} |
|
42 | 42 | id: 'instructions', |
43 | 43 | class: 'nicetext', |
44 | 44 | name: 'instructions', |
45 | | - value: field.instructions, |
46 | | - errors: field.errors.get('instructions'), |
| 45 | + value: old('instructions', field.instructions), |
| 46 | + errors: errors.get('instructions'), |
47 | 47 | data: { |
48 | 48 | 'error-key': 'instructions', |
49 | 49 | }, |
|
54 | 54 | label: 'Use this field’s values as search keywords'|t('app'), |
55 | 55 | id: 'searchable', |
56 | 56 | name: 'searchable', |
57 | | - on: field.searchable, |
| 57 | + on: old('searchable', field.searchable), |
58 | 58 | disabled: readOnly, |
59 | 59 | }) }} |
60 | 60 |
|
61 | 61 | {{ forms.customSelectField({ |
62 | 62 | label: "Field Type"|t('app'), |
63 | 63 | instructions: "What type of field is this?"|t('app'), |
64 | | - warning: (fieldId is not empty and not field.errors.has('type') ? "Changing this may result in data loss."|t('app')), |
| 64 | + warning: (fieldId is not empty and not errors.has('type') ? "Changing this may result in data loss."|t('app')), |
65 | 65 | id: 'type', |
66 | 66 | name: 'type', |
67 | 67 | options: fieldTypeOptions, |
68 | | - value: field is missing ? field.expectedType : className(field), |
69 | | - errors: field.errors.get('type'), |
| 68 | + value: old('type', field is missing ? field.expectedType : className(field)), |
| 69 | + errors: errors.get('type'), |
70 | 70 | data: { |
71 | 71 | 'error-key': 'type', |
72 | 72 | }, |
|
91 | 91 | 'language' in translationMethods ? { value: 'language', label: "Translate for each language"|t('app') }, |
92 | 92 | 'custom' in translationMethods ? { value: 'custom', label: "Custom…"|t('app') } |
93 | 93 | ]|filter, |
94 | | - value: field.translationMethodValue, |
| 94 | + value: old('translationMethod', field.translationMethodValue), |
95 | 95 | toggle: true, |
96 | 96 | targetPrefix: 'translation-method-', |
97 | 97 | disabled: readOnly, |
|
108 | 108 | id: 'translation-key-format', |
109 | 109 | class: 'code', |
110 | 110 | name: 'translationKeyFormat', |
111 | | - value: field.translationKeyFormat, |
112 | | - errors: field.errors.get('translationKeyFormat'), |
| 111 | + value: old('translationKeyFormat', field.translationKeyFormat), |
| 112 | + errors: errors.get('translationKeyFormat'), |
113 | 113 | data: {'error-key': 'translationKeyFormat'}, |
114 | 114 | disabled: readOnly, |
115 | 115 | }) }} |
|
0 commit comments