systopia / de.systopia.donrec

CiviCRM Donation Receipts Extension
GNU Affero General Public License v3.0
15 stars 25 forks source link

Compatibility problem? Issue donation receipts -> Send PDFs via Email don't work #190

Open Detsieber opened 7 months ago

Detsieber commented 7 months ago

In a (not unusual?) combination of versions, sending of pdfs via emails stalls. See attached log from Drupal Watchdog.

Versions: Drupal 9.5.11, CiviCRM 5.69.4, Donrec 2.2.0/ 2.2.7

watchdog.log

jofranz commented 7 months ago

Experiencing the same problem. @bjendres could you please have a look?

Details:

internal ref: 23974

Detsieber commented 7 months ago

I got a hint from my client:

I'm not a PHP let alone CiviCRM developer but looked at the trace you submitted at https://github.com/systopia/de.systopia.donrec/issues/190 and the issue looks like a regression from https://github.com/civicrm/civicrm-core/pull/27162/files#diff-1e9a2c9206f54b53575c95cad695187855a8539a1f58dfa96d902a7dfec0af1dR111 (CiviCRM 5.69 upstream) to me [...]

$params['model'] is assigned to array with the legacy receipt_text, and that array is passed verbatim/uncasted to Civi\WorkflowMessage\WorkflowMessage::importAll() https://github.com/civicrm/civicrm-core/blob/5.69.4/CRM/Core/BAO/MessageTemplate.php#L357

Commenting out the assigment of $params['model'] appears to solve the problem, but that's probably not the proper fix.

romymy commented 7 months ago

I experienced the same problem yesterday on Wordpress 6.4.3, PHP 8.1, CiviCRM 5.69.4 and Donrec 2.2.7. It turned out that a CiviCRM update to 5.69.5 brought the solution. Can anyone confirm that?

jonathandhn commented 6 months ago

Actually I don't know if it's related, but I've just issued my receipt prior to everybody else, and there is the PDF on the CRM, the email on my inbox, but no PDF joined in my inbox, and the only trace I could get is [STDERR] PHP Deprecated: Optional parameter $name declared before required parameter $contact_id is implicitly treated as a required parameter in /home/crm/public_html/web/sites/default/files/civicrm/ext/de.systopia.donrec/CRM/Donrec/Logic/File.php on line 52

Detsieber commented 6 months ago

Hi @jonathandhn Could it be that you are using Apple mail? There is an open issue with the way, email attachments are created by donrec, that makes them difficult to access from apple mail (although the attachment in fact is there).

jofranz commented 6 months ago

I experienced the same problem yesterday on Wordpress 6.4.3, PHP 8.1, CiviCRM 5.69.4 and Donrec 2.2.7. It turned out that a CiviCRM update to 5.69.5 brought the solution. Can anyone confirm that?

Thanks @romymy. I can confirm this solved it for at least five of our environments.