Hallo Joomla Community, ich habe da ein kleines Problem wo ich auf der Stelle trette und nicht genau weiß wie ich das Problem lösen kann. Dabei geht es um die Komponente AltaUserPoints. Im Backend kann ich zwar einem User mit einer Medallie auszeichnen aber diese wieder löschen verursacht den Fehler -> "$this when not in object context"
Vielleicht weiß ja jemand von euch einen Rat wie ich das Problem löse.
Joomla Version:
Joomla! version: Joomla! 3.9.13 Stable [ Amani ] 5-November-2019 Platform: Apache/2.4.25 (Debian) PHP version: 7.3.12-1+0~20191128.49+debian9~1.gbp24559b | safe_mode: Off | register_globals: Off | mbstring: Enabled | GD: 2.2.5 | MySQL version: 5.5.5-10.1.41-MariaDB-0+deb9u1 |
Fehlerausgabe:
0 Using $this when not in object context
/xxx/libraries/src/MVC/Controller/BaseController.php:1091
Call stack
# Function -- Location
1 () -- JROOT/libraries/src/MVC/Controller/BaseController.php:1091
2 Joomla\CMS\MVC\Controller\BaseController::setRedirect() -- JROOT/administrator/components/com_altauserpoints/models/statistics.php:382
3 altauserpointsModelStatistics->_delete_medaluser() -- JROOT/administrator/components/com_altauserpoints/controller.php:359
4 altauserpointsController->removemedaluser() -- JROOT/libraries/src/MVC/Controller/BaseController.php:710
5 Joomla\CMS\MVC\Controller\BaseController->execute() -- JROOT/administrator/components/com_altauserpoints/altauserpoints.php:31
6 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
7 Joomla\CMS\Component\ComponentHelper::executeComponent() -- JROOT/libraries/src/Component/ComponentHelper.php:377
8 Joomla\CMS\Component\ComponentHelper::renderComponent() -- JROOT/libraries/src/Application/AdministratorApplication.php:101
9 Joomla\CMS\Application\AdministratorApplication->dispatch() -- JROOT/libraries/src/Application/AdministratorApplication.php:159
10 Joomla\CMS\Application\AdministratorApplication->doExecute() -- JROOT/libraries/src/Application/CMSApplication.php:196
11 Joomla\CMS\Application\CMSApplication->execute() -- JROOT/administrator/index.php:51
Got error 'PHP message: PHP Deprecated: Non-static method Joomla\\CMS\\MVC\\Controller\\BaseController::setRedirect() should not be called statically in /xxxx/administrator/components/com_altauserpoints/models/statistics.php on line 382', referer: https://xxxxx/administrator/index.php?option=com_altauserpoints&task=edituser&cid[]=6587
Alles anzeigen
NR:5 JROOT/administrator/components/com_altauserpoints/altauserpoints.php:31
// Perform the Request task
$controller->execute( $app->input->get( 'task', 'cpanel', 'cmd' ) );
NR:3 JROOT/administrator/components/com_altauserpoints/controller.php:359
public function removemedaluser () {
$model = $this->getModel ( 'statistics' ); //Zeile 359
// delete user medal
$model->_delete_medaluser ();
}
NR:2 JROOT/administrator/components/com_altauserpoints/models/statistics.php:382
function _delete_medaluser() {
$app = JFactory::getApplication();
// initialize variables
$db = JFactory::getDBO();
$cid = JFactory::getApplication()->input->get('cid', 0, 'int');
$rid = JFactory::getApplication()->input->get('rid', 0, 'int');
$msgType = '';
if ($cid) {
// remove user medals
$query = "DELETE FROM #__alpha_userpoints_medals"
. "\n WHERE `id`=$cid AND rid=$rid";
$db->setQuery($query);
$db->query();
if (!$db->query()) {
$msg = $db->getErrorMsg();
$msgType = 'error';
} else $msg = JText::_('AUP_SUCCESSFULLYDELETED');
}
JControllerLegacy::setRedirect('index.php?option=com_altauserpoints&task=edituser&cid[]='.$rid, $msg); // Zeile 382
//JControllerLegacy::redirect();
}
Alles anzeigen
Backend View
<?php if ( $medalsexist ) { ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'addnewmedal', JText::_('AUP_AWARDED_NEW_MEDAL', true)); ?>
<?php if ( $this->medalslistuser ) { ?>
<legend><?php echo JText::_( 'AUP_MEDALS' ); ?></legend>
<table class="table table-bordered table-striped tabel-hover">
<tbody>
<?php foreach ( $this->medalslistuser as $medaluser ) { ?>
<tr>
<td width="15%">
<span class="editlinktip hasTip" title="<?php echo JText::_('AUP_DATE'); ?>">
<i class="icon-calendar visible-desktop"></i> <?php echo $medaluser->medaldate; ?>
</span>
</br>
<span class="editlinktip hasTip" title="<?php echo JText::_('AUP_CATEGORY'); ?>">
<i class="icon-folder-3 visible-desktop"></i> <?php echo $medaluser->path;?>
</span>
</td>
<td class="center" width="5%">
<?php
$pathicon = JURI::root() . 'components/com_altauserpoints/assets/images/awards/icons/';
$icon = '<img src="'.$pathicon . $medaluser->icon.'" max-width="40" height="auto" border="0" alt="" />';
echo $icon;
?>
</td>
<td width="20%">
<?php echo $medaluser->rank;?>
</td>
<td>
<?php // absenden- löschen der auszeichnung
$linkdelete = '<a class="btn btn-small btn-danger pull-right" href="index.php?option=com_altauserpoints&task=removemedaluser@@@WCF_LITERAL_AMP@@@cid='.$medaluser->id.'@@@WCF_LITERAL_AMP@@@rid='.$row->id.'"><i class="icon-delete"></i> '.JText::_( 'AUP_DELETE' ).'</a>';
echo $medaluser->reason;
echo $linkdelete;
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
Alles anzeigen
Eine Hilfeanfrage habe ich bereits beim Ersteller der Komponente verfasst nur leider ist mein Englich einfach zu schlecht.
ALs optische Hilfe.