From f80db559d568d3af846fae69b4faa31a3ded0787 Mon Sep 17 00:00:00 2001 From: Patrick Cool Date: Wed, 21 Mar 2007 11:03:16 +0100 Subject: [PATCH] [svn r11631] bugfix: SQL error when editing a link http://www.dokeos.com/forum/viewtopic.php?p=33820#33820 --- main/link/linkfunctions.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/main/link/linkfunctions.php b/main/link/linkfunctions.php index 1764c06ddb..1e8af05a32 100644 --- a/main/link/linkfunctions.php +++ b/main/link/linkfunctions.php @@ -224,11 +224,10 @@ function editlinkcategory($type) global $_user; global $_course; global $nameTools; - global $urllink; - global $title; - global $description; - global $category; - global $onhomepage; + global $urllink; + global $title; + global $description; + global $category; global $selectcategory; global $description; global $category_title; @@ -255,6 +254,15 @@ function editlinkcategory($type) // this is used to put the modified info of the link-form into the database if ($_POST['submitLink']) { + if ($_POST['onhomepage'] = '') + { + $onhomepage = 0; + } + else + { + $onhomepage = $_POST['onhomepage']; + } + // finding the old category_id $sql = "SELECT * FROM ".$tbl_link." WHERE id='".$_POST['id']."'"; $result = api_sql_query($sql, __FILE__, __LINE__);