JMAConsulting / biz.jmaconsulting.mte

Mandrill Emails Extension for CiviCRM
10 stars 21 forks source link

PHP Fatal error: Cannot break/continue 1 level in Mandrill.php on line 349 #93

Open shawnholt opened 9 years ago

shawnholt commented 9 years ago

Using PHP 5.5.27

I believe the 'continue' should be a 'return' (btw i only found this by looking at the php error_log in the drupal root - might want to do some kind of reporting)

public static function createActivity($value, $context = NULL, &$header = array()) { $sourceContactId = self::retrieveEmailContactId($value['msg']['sender'], TRUE); if (!CRM_Utils_Array::value('contact_id', $sourceContactId['email'])) { continue; }

shawnholt commented 8 years ago

This is definitely giving a contributor to the HTTP 500 error. If I change "continue' to 'return' it goes away (THIS IS A HACK!) I don't know if it isupposed to be 'return' or something else was intended. PHP error I see is : PHP Fatal error: Cannot break/continue 1 level in /home/xxxxx/public_html/drupal/sites/default/files/civicrm/extensions/biz.jmaconsulting.mte/CRM/Mte/BAO/Mandrill.php on line 349

shawnholt commented 8 years ago

NOTE this is not a fix! It is a HACK to avoid the 500 errors.

ginkgomzd commented 8 years ago

Reviewing this function, it seems clear that this is not just a hack but indeed the proper fix.

shawnholt commented 8 years ago

No more 500 error but bounce did not process for contact - could be related to a different error. perhaps you can comment or refactor so it is clear why the function is returning here. I was never able to successfully get bounce processing to work.

ginkgomzd commented 8 years ago

Please help test. https://github.com/JMAConsulting/biz.jmaconsulting.mte/pull/98

vakeesan26 commented 8 years ago

tested on CiviCRM 4.5.6 - WP 4.2.5 and CiviCRM 4.6.10 - Drupal 7 its working fine thank you @ginkgomzd

pradpnayak commented 8 years ago

Can you please update the extension and check if still get error

Here is the download link: https://github.com/JMAConsulting/biz.jmaconsulting.mte/archive/v2.1.beta.zip