Admidio / admidio

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
https://www.admidio.org
GNU General Public License v2.0
336 stars 131 forks source link

Message can´t be sent: Argument 2 passed to Email::addRecipient() must be of the type string #1369

Closed benhartwich closed 1 year ago

benhartwich commented 1 year ago

Describe the bug It seems that an announcement mail can´t be sent to a specific user group if there are some entries with missing mail addresses.

Expected behavior A missing mail address should be skipped. An error should be shown, which describes incorrect mail addresses / entries.

Desktop (please complete the following information):

Additional context This php error occurs, when we hit send at the message module by using a specific user list: `"PHP message: PHP Fatal error: Uncaught TypeError: Argument 2 passed to Email::addRecipient() must be of the type string, null given, called in /var/www/verwaltung/htdocs/admidio/adm_program/system/classes/Email.php on line 268 and defined in /var/www/verwaltung/htdocs/admidio/adm_program/system/classes/Email.php:165 Stack trace:

0 /var/www/verwaltung/htdocs/admidio/adm_program/system/classes/Email.php(268): Email->addRecipient()

1 /var/www/verwaltung/htdocs/admidio/adm_program/modules/messages/messages_send.php(202): Email->addRecipientsByRole()

2 {main}

thrown in /var/www/verwaltung/htdocs/admidio/adm_program/system/classes/Email.php on line 165" while reading response header from upstream, server: verwaltung.xy.at, request: "POST /adm_program/modules/messages/messages_send.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm-verwaltung.sock:", host: "verwaltung.xy.at", referrer: "https://verwaltung.xy.at/adm_program/modules/messages/messages_write.php?role_uuid=2dcfeb6d-b707-4b3f-b50c-8c321cc3f793" `

Fasse commented 1 year ago

@benhartwich The error message from you is not about the email address, it's about the firstname. Do you have members without firstname?

benhartwich commented 1 year ago

Yes, some members are organisation entries.

Fasse commented 1 year ago

Ok, that's an unexpected dataset because firstname is a required field. But I will have a look if the function could be more tolerant.

Fasse commented 1 year ago

Could you implement my changes to your installation and try it again?

benhartwich commented 1 year ago

Yes, sure.