Skip to content

Commit 0cb5a85

Browse files
committed
Form::__construct() is not relying on parent constructor arguments
1 parent cd37d7d commit 0cb5a85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Forms/Form.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,14 @@ class Form extends Container implements Nette\Utils\IHtmlString
113113
*/
114114
public function __construct($name = NULL)
115115
{
116+
parent::__construct();
116117
if ($name !== NULL) {
117118
$this->getElementPrototype()->id = 'frm-' . $name;
118119
$tracker = new Controls\HiddenField($name);
119120
$tracker->setOmitted();
120121
$this[self::TRACKER_ID] = $tracker;
122+
$this->setParent(NULL, $name);
121123
}
122-
parent::__construct(NULL, $name);
123124
}
124125

125126

0 commit comments

Comments
 (0)