diff --git a/ChangeLog b/ChangeLog
index 8d8e9ac9c729ef6b4ab5df333ab32972e7442625..1b2cc24ef55f90700cb432fd016ebb95f3fe2044 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@ Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order
 Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page
 Fix: [ bug #2715 ] Statistics page has broken layout with long thirdparty names
 Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid
+Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter
 
 ***** ChangeLog for 3.5.6 compared to 3.5.5 *****
 Fix: Avoid missing class error for fetch_thirdparty method #1973
diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php
index 8f0d0836ed46a2023d4e6b1df8218b54e82ddcf0..d4c030f766495706f639e5a9b83ae7ec4a766a6d 100644
--- a/htdocs/societe/info.php
+++ b/htdocs/societe/info.php
@@ -40,6 +40,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe');
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
 $hookmanager->initHooks(array('infothirdparty'));
 
+$soc = new Societe($db);
 
 
 /*
@@ -59,27 +60,27 @@ $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->e
 $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
 llxHeader('',$langs->trans("ThirdParty"),$help_url);
 
-$soc = new Societe($db);
-$soc->fetch($socid);
-$soc->info($socid);
-
-/*
- * Affichage onglets
- */
-$head = societe_prepare_head($soc);
+if ($socid > 0)
+{
+	$result = $soc->fetch($socid);
 
-dol_fiche_head($head, 'info', $langs->trans("ThirdParty"),0,'company');
+	$soc->info($socid);
 
+	/*
+	 * Affichage onglets
+	 */
+	$head = societe_prepare_head($soc);
 
+	dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company');
 
-print '<table width="100%"><tr><td>';
-dol_print_object_info($soc);
-print '</td></tr></table>';
 
-print '</div>';
+	print '<table width="100%"><tr><td>';
+	dol_print_object_info($soc);
+	print '</td></tr></table>';
 
+	dol_fiche_end();
+}
 
 llxFooter();
 
 $db->close();
-?>