JMAConsulting / biz.jmaconsulting.mte

Mandrill Emails Extension for CiviCRM
10 stars 21 forks source link

Notice: Undefined index: html in mte_civicrm_alterMailParams() #75

Closed shawnholt closed 9 years ago

shawnholt commented 9 years ago

This consistently occurs with a paypal registration transaction. Full message below. I have seen this happen in the past with crawlers, but this was a legit registration. Notice: Undefined index: html in mte_civicrm_alterMailParams() (line 243 of /home/xxxxxx/public_html/drupal/sites/default/files/civicrm/extensions/biz.jmaconsulting.mte-1.5/mte.php).

Note that following this, I get a civicrm failure and backtrace. I do not know if the MTE is causing this or it is related to a different issue, but the trace (following this error) is: $Fatal Error Details = Array ( [message] => Could not find valid value for id [code] => ) https://xxxxx.com/civicrm/event/register?_qf_Confirm_display=1&rfp=1&qfKey=aaaaaa&token=aaaaa&PayerID=aaaaaaa Referrer https://www.paypal.com//cgi-bin/webscr?cmd=_express-checkout&token=aaaaaa (link is external) Message $backTrace = #0 /home/xxxxx/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Error.php(387): CRM_Core_Error::backtrace("backTrace", TRUE) #1 /home/xxxxx/public_html/drupal/sites/all/modules/civicrm/CRM/Utils/Request.php(105): CRM_Core_Error::fatal("Could not find valid value for id") #2 /home/xxxxx/public_html/drupal/sites/all/modules/civicrm/CRM/Event/StateMachine/Registration.php(53): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE) #3 /home/xxxxx/public_html/drupal/sites/all/modules/civicrm/CRM/Event/Controller/Registration.php(43): CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), TRUE) #4 /home/xxxxx/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(326): CRM_Event_Controller_Registration->__construct("Event Registration", TRUE, "null", NULL, "false") #5 /home/xxxxx/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(75): CRM_Core_Invoke::runItem((Array:15)) #6 /home/xxxxx/public_html/drupal/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3)) #7 /home/xxxxx/public_html/drupal/sites/all/modules/civicrm/drupal/civicrm.module(457): CRM_Core_Invoke::invoke((Array:3)) #8 [internal function](): civicrm_invoke("event", "register") #9 /home/xxxxx/public_html/drupal/includes/menu.inc(517): call_user_func_array("civicrm_invoke", (Array:2)) #10 /home/xxxxx/public_html/drupal/index.php(21): menu_execute_active_handler() #11 {main}

shawnholt commented 9 years ago

I think the assumption is that these are all html emails. The hook document mentions this :http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_alterMailParams but may want to test if html exists and if not, use "text"....

shawnholt commented 9 years ago

Also, noted that for event registration messages, mandril emails are sent, but there is no mandril sent activity for those emails. Perhaps that is due to this as well (ie. expecting html emails)... or it is another issue...

pradpnayak commented 9 years ago

@shawnholt sorry for late reply here

I don't think MTE has actually caused the fatal error. Were you able to replicate again?

Looking at the backtrace seems to me that the controller was unable to fetch the event id from qfkey. We have faced this kind of intermittent problem in past when registering through a payment processor. 2 cases that might have happened to cause the fatal error:

  1. Session was reset
  2. Cron for schedule job 'Clean-up Temporary Data and Files' might have run just prior of callback from pay pal.

Could you check by disabling the extension?

for: "Also, noted that for event registration messages, mandril emails are sent, but there is no mandril sent activity for those emails. Perhaps that is due to this as well (ie. expecting html emails)... or it is another issue..."

I think since it was a fatal error all the db transactions got rollback, therefore mail was sent but no activity was created.

We will include the fix for notice error for html in our next version

pradpnayak commented 9 years ago

@shawnholt : Are you still facing the same problem?

pradpnayak commented 9 years ago

Fixed notice error at PR https://github.com/JMAConsulting/biz.jmaconsulting.mte/pull/77

pradpnayak commented 9 years ago

Closing this since its been fixed in latest version of MTE