@@ -118,7 +118,7 @@ protected function saveOption($option, $categoryName, $existingOptionID = 0)
118118 {
119119 // default values
120120 $ optionName = $ optionType = $ validationPattern = $ outputClass = $ selectOptions = $ enableOptions = $ permissions = $ options = '' ;
121- $ required = $ editable = $ visible = $ searchable = $ isDisabled = $ askDuringRegistration = 0 ;
121+ $ editable = $ visible = $ isDisabled = 0 ;
122122 $ defaultValue = $ showOrder = null ;
123123
124124 // get values
@@ -134,21 +134,12 @@ protected function saveOption($option, $categoryName, $existingOptionID = 0)
134134 if (isset ($ option ['validationpattern ' ])) {
135135 $ validationPattern = $ option ['validationpattern ' ];
136136 }
137- if (isset ($ option ['required ' ])) {
138- $ required = \intval ($ option ['required ' ]);
139- }
140- if (isset ($ option ['askduringregistration ' ])) {
141- $ askDuringRegistration = \intval ($ option ['askduringregistration ' ]);
142- }
143137 if (isset ($ option ['editable ' ])) {
144138 $ editable = \intval ($ option ['editable ' ]);
145139 }
146140 if (isset ($ option ['visible ' ])) {
147141 $ visible = \intval ($ option ['visible ' ]);
148142 }
149- if (isset ($ option ['searchable ' ])) {
150- $ searchable = \intval ($ option ['searchable ' ]);
151- }
152143 if (isset ($ option ['showorder ' ])) {
153144 $ showOrder = \intval ($ option ['showorder ' ]);
154145 }
@@ -200,19 +191,26 @@ protected function saveOption($option, $categoryName, $existingOptionID = 0)
200191 'validationPattern ' => $ validationPattern ,
201192 'selectOptions ' => $ selectOptions ,
202193 'enableOptions ' => $ enableOptions ,
203- 'required ' => $ required ,
204- 'askDuringRegistration ' => $ askDuringRegistration ,
205194 'editable ' => $ editable ,
206195 'visible ' => $ visible ,
207196 'outputClass ' => $ outputClass ,
208- 'searchable ' => $ searchable ,
209197 'showOrder ' => $ showOrder ,
210198 'permissions ' => $ permissions ,
211199 'options ' => $ options ,
212200 'additionalData ' => \serialize ($ additionalData ),
213201 'originIsSystem ' => 1 ,
214202 ];
215203
204+ if (isset ($ option ['required ' ])) {
205+ $ data ['required ' ] = \intval ($ option ['required ' ]);
206+ }
207+ if (isset ($ option ['askduringregistration ' ])) {
208+ $ data ['askDuringRegistration ' ] = \intval ($ option ['askduringregistration ' ]);
209+ }
210+ if (isset ($ option ['searchable ' ])) {
211+ $ data ['searchable ' ] = \intval ($ option ['searchable ' ]);
212+ }
213+
216214 // update option
217215 if (!empty ($ result ['optionID ' ]) && $ this ->installation ->getAction () == 'update ' ) {
218216 $ userOption = new UserOption (null , $ result );
0 commit comments