Skip to content

Commit

Permalink
fix: set by default enable action if module is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Nakahiru committed Jul 30, 2024
1 parent fd52627 commit d7b1a39
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Adapter/Module/AdminModuleDataProvider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
Expand Down Expand Up @@ -285,7 +286,13 @@ public function setActionUrls(ModuleCollection $modules, ?string $specific_actio
if ($specific_action && array_key_exists($specific_action, $filteredUrls)) {
$urlActive = $specific_action;
} else {
$urlActive = key($filteredUrls);
// if there is an 'enable' action available set it as first button action
// instead of 'configure' action which is the first action in the list
if (array_key_exists('enable', $filteredUrls)) {
$urlActive = 'enable';
} else {
$urlActive = key($filteredUrls);
}
}

$moduleAttributes->set('urls', $filteredUrls);
Expand Down

0 comments on commit d7b1a39

Please sign in to comment.