File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -336,8 +336,8 @@ public function setHtmlId($id)
336336 public function getHtmlId ()
337337 {
338338 if (!isset ($ this ->control ->id )) {
339- $ form = $ this ->getForm (false );
340- $ this ->control ->id = sprintf (self ::$ idMask , $ this ->lookupPath (), $ form ? $ form ->getName () : '' );
339+ $ form = $ this ->getForm ();
340+ $ this ->control ->id = sprintf (self ::$ idMask , $ this ->lookupPath (), $ form ->getName ());
341341 }
342342 return $ this ->control ->id ;
343343 }
Original file line number Diff line number Diff line change @@ -13,15 +13,15 @@ require __DIR__ . '/../bootstrap.php';
1313Assert::exception (function () {
1414 $ input = new TextInput ('name ' );
1515 $ input ->getHtmlId ();
16- }, Nette \InvalidStateException::class, "Component '' is not attached to ''. " );
16+ }, Nette \InvalidStateException::class, "Component '' is not attached to 'Nette \\ Forms \\ Form '. " );
1717
1818
19- test (function () {
19+ Assert:: exception (function () {
2020 $ container = new Nette \Forms \Container ;
2121 $ container ->setParent (null , 'second ' );
2222 $ input = $ container ->addText ('name ' );
23- Assert:: same ( ' frm-name ' , $ input ->getHtmlId () );
24- });
23+ $ input ->getHtmlId ();
24+ }, Nette \InvalidStateException::class, " Component 'name' is not attached to 'Nette \\ Forms \\ Form'. " );
2525
2626
2727test (function () {
You can’t perform that action at this time.
0 commit comments