Ignore invalid values passed to `ShowOrderFormField::value()`
authorMatthias Schmidt <gravatronics@live.com>
Sun, 12 May 2019 16:26:49 +0000 (18:26 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 12 May 2019 16:26:49 +0000 (18:26 +0200)
See #2509

wcfsetup/install/files/lib/system/form/builder/field/ShowOrderFormField.class.php

index 1bf964eeb9a260bd3f837e84811c10879d06f2f3..703212bcf140400d1b8763c503109edc0b671e26 100644 (file)
@@ -99,7 +99,9 @@ class ShowOrderFormField extends SingleSelectionFormField {
                }
                
                if (count($keys) <= $value) {
-                       throw new \InvalidArgumentException("Unknown value '{$value}' as only " . count($keys) . " values are available.");
+                       // outdated `showOrder` values might cause errors; simply ignore those
+                       // outdated values
+                       return $this;
                }
                
                return parent::value($keys[$value]);