Skip to content

Commit

Permalink
collect triggers with Callback::set condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Sep 30, 2021
1 parent fcae73b commit ee4770c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ protected function getRunningCallbackArgs(bool $isTerminated, array $page): arra
$isTerminated = true;
}

if ($isTerminated) {
if ($isTerminated && $v->isTriggered() && $v->canTrigger()) {
$args[Callback::URL_QUERY_TRIGGER_PREFIX . $v->getUrlTrigger()] = $v->getTriggeredValue();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/CallbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function testViewUrlCallback(): void
$this->simulateCallbackTriggering($cb);

$expectedUrlCbApp = '?' . Callback::URL_QUERY_TRIGGER_PREFIX . 'aa=callback&' . Callback::URL_QUERY_TARGET . '=aa';
$expectedUrlCb = '?' . /*Callback::URL_QUERY_TRIGGER_PREFIX . 'aa=1&' .*/ Callback::URL_QUERY_TRIGGER_PREFIX . 'bb=callback&' . Callback::URL_QUERY_TARGET . '=bb';
$expectedUrlCb = '?' . Callback::URL_QUERY_TRIGGER_PREFIX . 'aa=1&' . Callback::URL_QUERY_TRIGGER_PREFIX . 'bb=callback&' . Callback::URL_QUERY_TARGET . '=bb';
$this->assertSame($expectedUrlCbApp, $cbApp->getUrl());
$this->assertSame($expectedUrlCb, $cb->getUrl());

Expand Down

0 comments on commit ee4770c

Please sign in to comment.