fix(sidebar): null-check en route de children para evitar TypeError en PHP 8.2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-24 08:52:26 -05:00
co-authored by Claude Sonnet 4.6
parent 0021af36a5
commit ba27511414
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -177,7 +177,7 @@ if (class_exists('ModuleRegistry', false)) {
// Sub-acordeón para links con hijos
$subId = $catId . '-sub-' . $slug . '-' . $lnkIdx;
$hasActive = false;
foreach ($children as $ch) { if ($_isActive($ch['route']) !== '') { $hasActive = true; break; } }
foreach ($children as $ch) { if (!empty($ch['route']) && $_isActive($ch['route']) !== '') { $hasActive = true; break; } }
?>
<li class="sb-sub-header<?= $hasActive ? ' has-active' : '' ?>"
onclick="sbToggleSub('<?= $subId ?>',this,event)">
@@ -188,8 +188,9 @@ if (class_exists('ModuleRegistry', false)) {
<li class="sb-sub-group<?= $hasActive ? '' : ' collapsed' ?>" id="<?= $subId ?>">
<ul>
<?php foreach ($children as $ch):
$href = $_base . $ch['route'];
$active = $_isActive($ch['route']);
$chRoute = $ch['route'] ?? '';
$href = $chRoute ? $_base . $chRoute : '#';
$active = $chRoute ? $_isActive($chRoute) : '';
?>
<li><a href="<?= htmlspecialchars($href, ENT_QUOTES, 'UTF-8') ?>"
class="nav-link nav-link-sub<?= $active ?>">