From 328e591475ff36cbac7cb4e77a7b644d439dc198 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Tue, 4 Feb 2020 11:03:02 +0100 Subject: [PATCH] fix(form): list of forms on homepage if the access type is restricted, bad foreign key Signed-off-by: Thierry Bugier --- inc/form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/form.class.php b/inc/form.class.php index 1bf01cec9..0a32fe8d8 100644 --- a/inc/form.class.php +++ b/inc/form.class.php @@ -2496,7 +2496,7 @@ public static function getFormRestrictionCriterias($formTable = '') { if ($formTable == '') { $formTable = PluginFormcreatorForm::getTable(); } - $formProfileFk = Profile::getForeignKeyField(); + $formFk = self::getForeignKeyField(); $table_fp = PluginFormcreatorForm_Profile::getTable(); $entitiesRestrict = (new DBUtils())->getEntitiesRestrictCriteria($formTable, '', '', true, false); $language = $_SESSION['glpilanguage']; @@ -2509,7 +2509,7 @@ public static function getFormRestrictionCriterias($formTable = '') { 'OR' => [ "$formTable.access_rights" => ['<>', PluginFormcreatorForm::ACCESS_RESTRICTED], "$formTable.id" => new QuerySubQuery([ - 'SELECT' => $formProfileFk, + 'SELECT' => $formFk, 'FROM' => $table_fp, 'WHERE' => [ 'profiles_id' => $_SESSION['glpiactiveprofile']['id']