added test cases, remove activeClass from output if no target set
All checks were successful
CI / testsuite (sqlite, 8.2, ) (push) Successful in 12m46s
CI / testsuite (sqlite, 8.2, prefer-lowest) (push) Successful in 12m35s
CI / testsuite (sqlite, 8.4, ) (push) Successful in 10m20s
CI / Coding Standard & Static Analysis (push) Successful in 13m51s
CI / testsuite (mysql, 8.2, ) (push) Successful in 5m9s
CI / testsuite (mysql, 8.4, ) (push) Successful in 6m20s
CI / testsuite (pgsql, 8.2, ) (push) Successful in 5m16s
CI / testsuite (pgsql, 8.4, ) (push) Successful in 5m51s

This commit is contained in:
2026-05-01 00:27:26 -07:00
parent a70733db9d
commit 75fc0f64fa
2 changed files with 33 additions and 0 deletions

View File

@@ -42,6 +42,8 @@ class ActiveLinkHelper extends Helper {
public function link(array|string $title, array|string|null $url = null, array $options = []): string {
$currentUrl = $options['current'] ?? Router::parseRequest($this->getView()->getRequest());
if (!array_key_exists('target', $options) || !$currentUrl) {
unset($options['activeClass']);
return $this->Html->link($title, $url, $options);
}