\n";
+ }
+ }
+
// Ask delivery receipt
if (! empty($this->withdeliveryreceipt))
{
@@ -636,7 +636,7 @@ class FormMail extends Form
$defaulttopic=make_substitutions($defaulttopic,$this->substit);
$out.= '
';
- $out.= '
'.$langs->trans("MailTopic").'
';
+ $out.= '
'.$langs->trans("MailTopic").'
';
$out.= '
';
if ($this->withtopicreadonly)
{
diff --git a/htdocs/modulebuilder/template/scripts/myobject.php b/htdocs/modulebuilder/template/scripts/myobject.php
index f83a808a0b9..a8c280193ea 100644
--- a/htdocs/modulebuilder/template/scripts/myobject.php
+++ b/htdocs/modulebuilder/template/scripts/myobject.php
@@ -43,7 +43,12 @@ $error=0;
define('EVEN_IF_ONLY_LOGIN_ALLOWED',1); // Set this define to 0 if you want to lock your script when dolibarr setup is "locked to admin user only".
// Include and load Dolibarr environment variables
-require_once($path."../../htdocs/master.inc.php");
+$res=0;
+if (! $res && file_exists($path."master.inc.php")) $res=@include($path."master.inc.php");
+if (! $res && file_exists($path."../master.inc.php")) $res=@include($path."../master.inc.php");
+if (! $res && file_exists($path."../../master.inc.php")) $res=@include($path."../../master.inc.php");
+if (! $res && file_exists($path."../../../master.inc.php")) $res=@include($path."../../../master.inc.php");
+if (! $res) die("Include of master fails");
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
// $user is created but empty.