From: Matthias Schmidt Date: Sun, 9 Sep 2018 07:31:13 +0000 (+0200) Subject: Fix form field dependency check for nested dependencies X-Git-Tag: 5.2.0_Alpha_1~676^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5519da5cea3d8865e39737b1963aaddd20619df2;p=GitHub%2FWoltLab%2FWCF.git Fix form field dependency check for nested dependencies If field C depends on field B which in turn depends on field A and if field B is unavailable because of its dependencies on field A, field C's explicit dependencies on field B might have still be fulfilled even though field B is unavailable. Instead of just checking the dependency, we must also check if the depending field fulfills its dependencies. See #2509 --- diff --git a/wcfsetup/install/files/lib/system/form/builder/TFormNode.class.php b/wcfsetup/install/files/lib/system/form/builder/TFormNode.class.php index fd6838261e..8f432113af 100644 --- a/wcfsetup/install/files/lib/system/form/builder/TFormNode.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/TFormNode.class.php @@ -148,7 +148,9 @@ trait TFormNode { public function checkDependencies() { if (!empty($this->dependencies)) { foreach ($this->dependencies as $dependency) { - if (!$dependency->checkDependency()) { + // check dependencies directly and check if a dependent + // field itself is unavailable because of its dependencies + if (!$dependency->checkDependency() || !$dependency->getField()->checkDependencies()) { return false; } }