From ee4770c4a8e58bdd8bc66d09a2be925953facfe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Tue, 27 Jul 2021 10:27:32 +0200 Subject: [PATCH] collect triggers with Callback::set condition --- src/View.php | 2 +- tests/CallbackTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/View.php b/src/View.php index 76888d73c3..a1a244205a 100644 --- a/src/View.php +++ b/src/View.php @@ -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(); } } diff --git a/tests/CallbackTest.php b/tests/CallbackTest.php index 27b4a0cb82..9f8a97c538 100644 --- a/tests/CallbackTest.php +++ b/tests/CallbackTest.php @@ -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());