Hi,
In CF7, the link to the edit page from a server-side processing PHP page worked correctly. Now I'm trying it in CF8, but it's not working. The URL is also displayed correctly in the browser with the ID.
What's the problem?
CF7: ?art_id=3&gpage=edit
CF8: /index.php/redaktionsbereich/hauptliste-bearbeiten?art_id=' . htmlspecialchars($art_id, ENT_QUOTES, 'UTF-8') . '&chronopage=edit">';
F.
Hi Fred
Where do you place this link ? in a PHP action ?
no, in PHP File of the server (server-side processing PHP)
for CF7 ok: $ret = '<a href="/index.php/redaktionsbereich/hauptliste-bearbeiten?art_id=' . htmlspecialchars($art_id, ENT_QUOTES, 'UTF-8') . '&gpage=edit">';
This thread can be closed. This is the answer:
$url = '/index.php/redaktionsbereich/hauptliste-bearbeiten?art_id=' . rawurlencode($art_id) . '&chronopage=edit';
echo '<a href="' . htmlspecialchars($url, ENT_QUOTES, 'UTF-8') . '">';
Thank you for the information.
In CF7, the code in the server-side processing PHP file works without any problems:
[
'db' => null, 'dt' => 14, 'export' => null,
'formatter' => function($d, $row) {
$art_id = $row['art_id'];
$ret = '<a href="/index.php/redaktionsbereich/hauptliste-bearbeiten?art_id='
. htmlspecialchars($art_id, ENT_QUOTES, 'UTF-8') . '&gpage=edit">';
$ret .= '<i class="fa fa-edit"></i>';
$ret .= '</a>';
return $ret;
}
]
In CF8, the code doesn't work, even when "&gpage=edit" is replaced with "&chronopage=edit".
However, this code produces the correct URL in the frontend and works without any issues:
foreach ($columns as $c) {
$rowData[] = $row[$c['db']] ?? null;
}
// zusätzliche virtuelle Spalte (Edit-Link) falls du sie brauchst:
$art_id = $row['art_id'] ?? '';
$url = '/index.php/redaktionsbereich/hauptliste-bearbeiten?art_id=' . rawurlencode($art_id) . '&chronopage=edit';
$rowData[] = '<a href="' . htmlspecialchars($url, ENT_QUOTES, 'UTF-8') . '"><i class="fa fa-edit"></i></a>';
$data[] = $rowData;
}
