Skip to content

Commit

Permalink
Merge pull request #546 from HosipLan/bug/create-request-array-in-args
Browse files Browse the repository at this point in the history
Presenter: fixed notice "array to string conversion" for PHP 5.4
  • Loading branch information
dg committed Feb 24, 2012
2 parents 8e48219 + 705148f commit 61dd89f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 1 addition & 7 deletions Nette/Application/UI/Presenter.php
Expand Up @@ -965,13 +965,7 @@ final protected function createRequest($component, $destination, array $args, $m

$globalState = $this->getGlobalState($destination === 'this' ? NULL : $presenterClass);
if ($current && $args) {
$tmp = $globalState + $this->params;
foreach ($args as $key => $val) {
if ((string) $val !== (isset($tmp[$key]) ? (string) $tmp[$key] : '')) {
$current = FALSE;
break;
}
}
$current = http_build_query($globalState + $this->params) === http_build_query($args);
}
$args += $globalState;
}
Expand Down
1 change: 1 addition & 0 deletions tests/Nette/Application.UI/Presenter.link().phpt
Expand Up @@ -122,6 +122,7 @@ class TestPresenter extends Application\UI\Presenter
Assert::same( 'error: Signal must be non-empty string.', $this->link('!') );
Assert::same( '/index.php?action=default&presenter=Test', $this->link('this', array('var1' => $this->var1)) );
Assert::same( '/index.php?action=default&presenter=Test', $this->link('this!', array('var1' => $this->var1)) );
Assert::same( '/index.php?sort%5By%5D%5Basc%5D=1&action=default&presenter=Test', $this->link('this', array('sort' => array('y' => array('asc' => TRUE)))) );

// Component link
Assert::same( 'error: Signal must be non-empty string.', $this->mycontrol->link('', 0, 1) );
Expand Down

0 comments on commit 61dd89f

Please sign in to comment.