File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,20 @@ public function validateLogLevel($attribute)
206206 }
207207 }
208208
209+ /**
210+ * Custom setter for enabledIconTypes to normalize boolean values
211+ * Converts string values ("1", "") to proper booleans (true, false)
212+ */
213+ public function setEnabledIconTypes (array $ value ): void
214+ {
215+ // Normalize all values to booleans
216+ foreach ($ value as $ type => $ enabled ) {
217+ $ value [$ type ] = filter_var ($ enabled , FILTER_VALIDATE_BOOLEAN );
218+ }
219+
220+ $ this ->enabledIconTypes = $ value ;
221+ }
222+
209223 /**
210224 * Get the resolved icon sets path
211225 */
@@ -276,6 +290,14 @@ public static function loadFromDatabase(?Settings $settings = null): self
276290 // Decode JSON fields
277291 if (isset ($ row ['enabledIconTypes ' ])) {
278292 $ row ['enabledIconTypes ' ] = Json::decode ($ row ['enabledIconTypes ' ]);
293+
294+ // Convert string values to booleans for strict comparison
295+ // Database may store "1"/"" instead of true/false
296+ if (is_array ($ row ['enabledIconTypes ' ])) {
297+ foreach ($ row ['enabledIconTypes ' ] as $ type => $ enabled ) {
298+ $ row ['enabledIconTypes ' ][$ type ] = filter_var ($ enabled , FILTER_VALIDATE_BOOLEAN );
299+ }
300+ }
279301 }
280302
281303 // Set attributes from database
You can’t perform that action at this time.
0 commit comments