mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-10 01:42:33 +01:00
Fixed Bug : email sending test #36741 @defrance --> Issue fixed The problem was caused by initializing $result = 0 in core/actions_sendmails.inc.php. When sending a test email from Setup → Emails, there is no $object to fetch. As a result, $result remained 0 and the code incorrectly triggered ErrorFailedToReadObject. The fix consists in explicitly setting $result = 1 when no $object is provided (test email / generic email context). This correctly treats the absence of an object as a valid case and restores the ability to send test emails, while keeping $result properly initialized. Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -189,6 +189,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
|
||||
}
|
||||
} else {
|
||||
$thirdparty = $mysoc;
|
||||
$result = 1; // No object to fetch (e.g. Setup -> Emails -> send test email): consider OK
|
||||
}
|
||||
|
||||
if ($result > 0) {
|
||||
|
||||
Reference in New Issue
Block a user