Ignore invalid PIP field values when `objectProperty` is used
authorMatthias Schmidt <gravatronics@live.com>
Sat, 7 Jul 2018 15:26:03 +0000 (17:26 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 7 Jul 2018 15:26:03 +0000 (17:26 +0200)
See #2545

wcfsetup/install/files/lib/system/devtools/pip/TXmlGuiPackageInstallationPlugin.class.php

index 6ef09a2e2b4be55e5e47b638b3c97c9b0b622308..6e0ed9f4e179cb40b1b2d131783fb33ecf73f445 100644 (file)
@@ -344,8 +344,16 @@ XML;
                                else if ($node->getObjectProperty() !== $node->getId()) {
                                        $key = $node->getObjectProperty();
                                        
-                                       if (isset($data[$key])) {
-                                               $node->value($data[$key]);
+                                       try {
+                                               if (isset($data[$key])) {
+                                                       $node->value($data[$key]);
+                                               }
+                                       }
+                                       catch (\InvalidArgumentException $e) {
+                                               // ignore invalid argument exceptions for fields with object property
+                                               // as there might be multiple fields with the same object property but
+                                               // different possible values (for example when using single selection
+                                               // form fields to set the parent element)
                                        }
                                }
                        }