From 58cbfa8c877f51fe0111cb0dbd496d22d013e1cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 Oct 2024 17:59:35 +0200 Subject: [PATCH] FIX Edit a link --- htdocs/core/class/html.formfile.class.php | 3 +-- htdocs/core/class/link.class.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index de999b305bb..8cf0dc801ce 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -2153,11 +2153,10 @@ class FormFile if ($nboflinks > 0) { include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; } - foreach ($links as $link) { print ''; //edit mode - if ($action == 'update' && $selected === $link->id) { + if ($action == 'update' && $selected === (int) $link->id) { print ''; print ''; print ''; diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 34f05db4c11..8ea08e7d52a 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -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;