Skip to content

Commit d07e9d8

Browse files
morfin60tabacitu
authored andcommitted
Fixed missing use ($name) in reject calls (#110)
* Fixed missing use($name) in reject calls Without use($name) it was not avaliable in lambda and causing fatal error when trying to removeButton or removeButtonFromStack * Update Buttons.php Missing spaces * Update Buttons.php * Update Buttons.php Writing resulting array after reject into $this->buttons property
1 parent ed966ec commit d07e9d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PanelTraits/Buttons.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ public function initButtons()
7676

7777
public function removeButton($name)
7878
{
79-
$this->buttons->reject(function ($button) {
79+
$this->buttons = $this->buttons->reject(function ($button) use ($name) {
8080
return $button->name == $name;
8181
});
8282
}
8383

8484
public function removeButtonFromStack($name, $stack)
8585
{
86-
$this->buttons->reject(function ($button) {
86+
$this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) {
8787
return $button->name == $name && $button->stack == $stack;
8888
});
8989
}

0 commit comments

Comments
 (0)