Skip to content

Commit 2c7337a

Browse files
authored
Merge pull request #10 from NoResponseMate/quick-fix-of-adding-actions
[Grid] Fix conditions of adding actions
2 parents 85231a6 + f052171 commit 2c7337a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Grid/Checker/ExportableChecker.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ public function canBeExported(Grid $grid, object|string|null $section): bool
3232
return false;
3333
}
3434

35-
if (null === $section) {
36-
return true;
37-
}
38-
3935
$resourceAlias = $this->resourceRegistry->getByClass($resourceClass)->getAlias();
4036

4137
$resourceConfig = $this->exportResourcesConfig[$resourceAlias] ?? false;
4238
if (false === $resourceConfig) {
4339
return false;
4440
}
4541

42+
if (null === $section) {
43+
return true;
44+
}
45+
4646
foreach ($resourceConfig['sections'] as $configSection) {
4747
if (is_a($section, $configSection, true) || $section === $configSection) {
4848
return true;

0 commit comments

Comments
 (0)