Morgen,
ich habe folgenden Code:
PHP-Code:
/**
* @Callback(table="tl_fs_geo_locations", target="list.operations.delete.button")
*/
public function DeleteButtonCallback($arrRow, $href, $label, $title, $icon, $attributes, $strTable, $arrRootIds, $arrChildRecordIds, $blnCircularReference, $strPrevious, $strNext, DataContainer $dc): string
{
$cnt = Database::getInstance()->prepare("SELECT COUNT(id) as cnt FROM tl_calendar_events WHERE fs_location=? OR fs_location_old=?")->execute($arrRow['id'],$arrRow['id']);
if($cnt->cnt == 0) {
$icon = 'delete.svg';
return '<a href="'.Controller::addToUrl($href.'&id='.$arrRow['id']).'" title="'.StringUtil::specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a>';
} else {
$icon = 'delete_.svg';
return Image::getHtml($icon, $label);
}
}
Das erzeugt mir folgenden Link: contao?do=fs_cpl&act=delete&id=144&ref=h6yg00C2
scheinbar fehlt da aber der Token wie hier: contao?do=fs_cpl&table=tl_fs_geo_locations&id=144&rt=rzq7YoqZpArX5DlaltnDeIm6uMN4_bSpTyPT7oXgulg&ref=h6yg00C2
Sollte dieser nicht in $href automatisch drin stehen?
Lesezeichen