Laurent Destailleur 2 years ago
parent
commit
af90eb0d02

+ 5 - 1
htdocs/modulebuilder/index.php

@@ -2735,8 +2735,10 @@ if ($module == 'initmodule') {
 
 						if (empty($forceddirread) && empty($dirread)) {
 							$result = dol_include_once($pathtoclass);
+							$stringofinclude = "dol_include_once(".$pathtoclass.")";
 						} else {
 							$result = @include_once $dirread.'/'.$pathtoclass;
+							$stringofinclude = "@include_once ".$dirread.'/'.$pathtoclass;
 						}
 						if (class_exists($tabobj)) {
 							try {
@@ -2744,6 +2746,8 @@ if ($module == 'initmodule') {
 							} catch (Exception $e) {
 								dol_syslog('Failed to load Constructor of class: '.$e->getMessage(), LOG_WARNING);
 							}
+						} else {
+							print '<span class="warning">'.$langs->trans('Failed to find the class '.$tabobj.' despite the '.$stringofinclude).'</warning><br>';
 						}
 
 						if (!empty($tmpobjet)) {
@@ -3078,7 +3082,7 @@ if ($module == 'initmodule') {
 
 							print '</form>';
 						} else {
-							print '<tr><td><span class="warning">'.$langs->trans('Failed to init the object with the new.').'</warning></td></tr>';
+							print '<span class="warning">'.$langs->trans('Failed to init the object with the new '.$tabobj.'($db)').'</warning>';
 						}
 					} catch (Exception $e) {
 						print $e->getMessage();

+ 1 - 0
htdocs/modulebuilder/template/langs/en_US/mymodule.lang

@@ -44,6 +44,7 @@ MyModuleAboutPage = MyModule about page
 #
 # Sample page
 #
+MyModuleArea = Home MyModule
 MyPageName = My page name
 
 #

+ 2 - 2
htdocs/partnership/partnership_card.php

@@ -83,8 +83,8 @@ $managedfor 			= getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty');
 
 if (empty($conf->partnership->enabled)) accessforbidden();
 if (empty($permissiontoread)) accessforbidden();
-if ($object->id > 0 && $object->fk_member > 0 && $managedfor != 'member') accessforbidden();
-if ($object->id > 0 && $object->fk_soc > 0 && $managedfor != 'thirdparty') accessforbidden();
+if ($object->id > 0 && !($object->fk_member > 0) && $managedfor == 'member') accessforbidden();
+if ($object->id > 0 && !($object->fk_soc > 0) && $managedfor == 'thirdparty') accessforbidden();
 
 
 /*