Fix undefined variable $userId notice

This commit is contained in:
Tuan Pham Ngoc 2023-11-28 10:32:42 +07:00
parent c54c5af898
commit 6749120fbf
1 changed files with 3 additions and 3 deletions

View File

@ -23,8 +23,8 @@ $user = Factory::getApplication()->getIdentity();
$canEdit = $user->authorise('core.edit', 'com_weblinks.category.' . $this->category->id); $canEdit = $user->authorise('core.edit', 'com_weblinks.category.' . $this->category->id);
$canEditOwn = $user->authorise('core.edit.own', 'com_weblinks.category.' . $this->category->id); $canEditOwn = $user->authorise('core.edit.own', 'com_weblinks.category.' . $this->category->id);
$canCreate = $user->authorise('core.create', 'com_weblinks.category.' . $this->category->id); $canCreate = $user->authorise('core.create', 'com_weblinks.category.' . $this->category->id);
$listOrder = $this->escape($this->state->get('list.ordering')); $listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction')); $listDirn = $this->escape($this->state->get('list.direction'));
?> ?>
<div class="com-weblinks-category__items"> <div class="com-weblinks-category__items">
@ -84,7 +84,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
<?php <?php
endif; ?> endif; ?>
<?php if ($canEdit || ($canEditOwn && $item->created_by == $userId)) : <?php if ($canEdit || ($canEditOwn && $item->created_by == $user->id)) :
?> ?>
<div class="icons list-group-item"> <div class="icons list-group-item">
<?php echo HTMLHelper::_('weblinkicon.edit', $item, $item->params); ?> <?php echo HTMLHelper::_('weblinkicon.edit', $item, $item->params); ?>