diff --git a/forms/ComplexTableField.php b/forms/ComplexTableField.php index 43850d97a..40c94e897 100755 --- a/forms/ComplexTableField.php +++ b/forms/ComplexTableField.php @@ -1080,7 +1080,12 @@ class ComplexTableField_Popup extends Form { Requirements::javascript(SAPPHIRE_DIR . "/javascript/ComplexTableField_popup.js"); // Append requirements from instance callbacks - $callback = $this->getParentController()->getParentController()->requirementsForPopupCallback; + $parent = $this->getParentController(); + if($parent instanceof ComplexTableField) { + $callback = $parent->requirementsForPopupCallback; + } else { + $callback = $parent->getParentController()->requirementsForPopupCallback; + } if($callback) call_user_func($callback, $this); // Append requirements from DataObject