Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I get this error in my log when the Ubercart module processes a payment from PayPal:
Notice: Trying to get property of non-object in _mail_edit_load() (line 24 of /home/name/public_html/sites/all/modules/mail_edit/mail_edit.alter.inc).
What might cause it?
Comment | File | Size | Author |
---|---|---|---|
#12 | 1323938-drupal-mail.patch | 2.25 KB | TR |
#10 | stack-trace.jpg | 105.7 KB | sah62 |
#8 | errors.jpg | 31.3 KB | sah62 |
Comments
Comment #1
salvisI can't tell from here.
Please install the Devel module and enable the traceback handler. In the stack trace expand the top item and post a screenshot of the entire stack trace, so that we can see what arguments are being passed to _mail_edit_load().
Try to find the drupal_mail() call in the stack trace and show its arguments, too.
Comment #2
sah62 CreditAttribution: sah62 commentedI'll see what I can do to reproduce and capture the error.
Comment #3
sah62 CreditAttribution: sah62 commentedMaybe I'm doing something wrong, but I've installed and enabled the Devel module, installed the krumo library in sites/all/modules/devel, turned on the Backtrace error handler, reproduced the error, and nothing happens - no stack trace, just the same old log entry. Do I need to enable something else?
Comment #4
salvisI'm confused — Krumo is included with Devel, you should not do any separate step for this.
If you're not using user 1, you need to give a permission, something like 'view devel information'. The link to the permissions page is on the modules page.
Comment #5
sah62 CreditAttribution: sah62 commentedWhen things weren't working I went looking for info and found this: http://drupal.org/node/274715. Must be old info.
Anyway, I've checked permissions, and set "Error messages to display" to "All messages" on the logging admin page. "Error handler" is set to "Backtrace" on the Devel admin page. I can reproduce the error and see it appear in my log, but no messages appear in my browser window as I click through the UI. I upgraded to Drupal 7.9 earlier this morning - could that have broken something?
Comment #6
salvisYes, that information is obsolete. I added a comment there.
You may have broken your Devel installation. I'd disable and uninstall Devel, manually remove any left-overs (including traces of your manual Krumo installation), and reinstall Devel.
Let me check whether I can simulate the error...
Comment #7
salvisHere's a screenshot of what it looks like if I purposely add code that produces that error (there's admin_menu at the top):
Your best bet is to use user 1.
Comment #8
sah62 CreditAttribution: sah62 commentedThanks, I really appreciate your patience with a Drupal non-developer.
I just tried another test with the latest dev release of the Devel module. Now I'm seeing the error message (image attached), but still nothing from Krumo.Is there some kind of basic test I can run to make sure it's working properly?
Comment #9
salvisNo, unfortunately there's no easy test. Are you a) user 1 and b) on a development server (i.e. not a server)? If you answer yes to both, there is something we can try, if the procedure below doesn't help.
I have a suspicion that the error might be generated at an awkward moment and that this might be the reason why you don't see the message. Or your theme might be hiding it. Or...
Can you try editing the devel.module file? Look for
near line 1830 and replace it with
This might help.
Thank you for pursuing this, I'm very interested in getting this resolved.
Comment #10
sah62 CreditAttribution: sah62 commentedThat made a difference - thanks! I've attached a picture of the trace with the arguments displayed.
So what might be broken with krumo?
Comment #11
salvisThank you for posting the screenshot!
It shows that uc_cart_complete_sale_account() calls drupal_mail() with NULL as arg(3). That's the $language parameter, which is not optional according to http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail/7 .
Ubercart needs to fix this.
@sah62: Please set Version to the UC version that you're using.
(Regarding Devel: Usually krumo() and dpm() work both, but there are cases where dpm() doesn't. Now, apparently, there are also cases where krumo() doesn't. I'll update Devel to offer both options.)
Comment #12
TR CreditAttribution: TR commentedTry this patch and let me know if it solves the problem.
Comment #13
longwaveCommitted #12.
Comment #14
sah62 CreditAttribution: sah62 commentedThe patch fixes the mail_edit error - thanks. I have another error raised in the profile module during the payment process, but that doesn't belong here. I'll debug that a bit and report it in the right place (update: it's already been reported: http://drupal.org/node/777168). Thanks for everyone's help!