From 5519da5cea3d8865e39737b1963aaddd20619df2 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 9 Sep 2018 09:31:13 +0200 Subject: [PATCH] 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 --- .../install/files/lib/system/form/builder/TFormNode.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } } -- 2.20.1