Merge pull request #29094 from alxarafe/develop

"Fatal error: Uncaught Error: Call to undefined method stdClass::del_…
This commit is contained in:
Laurent Destailleur 2024-03-28 13:37:22 +01:00 committed by GitHub
commit 60f9acb0e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2005-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 Rafael San José <rsanjose@alxarafe.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -115,7 +116,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers
// Add user into some linked tools (mailman, spip, etc...)
if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid)) {
if (is_object($object->oldcopy) && (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid))) { // If email has changed or if list has changed we delete mailman subscription for old email
if ($object->oldcopy->del_to_abo() < 0) {
if (method_exists($object->oldcopy, 'del_to_abo') && $object->oldcopy->del_to_abo() < 0) {
$this->errors = $object->oldcopy->errors;
if (!empty($object->oldcopy->error)) {
$this->errors[] = $object->oldcopy->error;