Skip to content

Commit

Permalink
DefaultRenderer: fix for calling renderErrors() from renderPair() whi…
Browse files Browse the repository at this point in the history
…ch was caused by #145 (->form = NULL) (#150)
  • Loading branch information
Vlczech authored and dg committed Jun 21, 2017
1 parent 4cba408 commit 32d2cf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Forms/Rendering/DefaultFormRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ public function renderEnd(): string
*/
public function renderErrors(Nette\Forms\IControl $control = NULL, bool $own = TRUE): string
{
$translator = $this->form->getTranslator();
$translator = $control
? ($control instanceof \Nette\Forms\Controls\BaseControl ? $control->getTranslator() : NULL)
: $this->form->getTranslator();

$errors = $control
? $control->getErrors()
Expand Down

0 comments on commit 32d2cf0

Please sign in to comment.