Skip to content

Commit

Permalink
fix VpExecutor final step sticky issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Jan 23, 2024
1 parent 9381470 commit 724645c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/UserAction/VpExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Atk4\Core\HookTrait;
use Atk4\Data\Model;
use Atk4\Ui\Button;
use Atk4\Ui\Callback;
use Atk4\Ui\Header;
use Atk4\Ui\Js\JsBlock;
use Atk4\Ui\Js\JsChain;
Expand Down Expand Up @@ -158,6 +159,11 @@ protected function jsGetExecute($obj, $id): JsBlock
? ($this->jsSuccess)($this, $this->action->getModel(), $id, $obj)
: $this->jsSuccess;

// needed for https://github.com/atk4/ui/pull/2142
// but TODO as previously https://github.com/atk4/ui/blob/5.0.0/demos/data-action/jsactions-vp.php demo
// was already broken - run "Argument/Preview" action and then notice "Undefined index: age" exception when run again
unset($this->stickyArgs[Callback::URL_QUERY_TRIGGER_PREFIX . \Closure::bind(fn ($cb) => $cb->urlTrigger, null, Callback::class)($this->cb)]);

return new JsBlock([
JsBlock::fromHookResult($this->hook(BasicExecutor::HOOK_AFTER_EXECUTE, [$obj, $id]) // @phpstan-ignore-line
?: ($success ?? new JsToast('Success' . (is_string($obj) ? (': ' . $obj) : '')))),
Expand Down

0 comments on commit 724645c

Please sign in to comment.