FIX Edit a link

This commit is contained in:
Laurent Destailleur 2024-10-24 17:59:35 +02:00
parent a11e369e5c
commit 58cbfa8c87
2 changed files with 2 additions and 3 deletions

View file

@ -2153,11 +2153,10 @@ class FormFile
if ($nboflinks > 0) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
}
foreach ($links as $link) {
print '<tr class="oddeven">';
//edit mode
if ($action == 'update' && $selected === $link->id) {
if ($action == 'update' && $selected === (int) $link->id) {
print '<td>';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="linkid" value="'.$link->id.'">';

View file

@ -254,7 +254,7 @@ class Link extends CommonObject
if ($num > 0) {
while ($obj = $this->db->fetch_object($resql)) {
$link = new Link($this->db);
$link->id = $obj->rowid;
$link->id = (int) $obj->rowid;
$link->entity = $obj->entity;
$link->datea = $this->db->jdate($obj->datea);
$link->url = $obj->url;