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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

salvis’s picture

Status: Active » Postponed (maintainer needs more info)

I 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.

sah62’s picture

I'll see what I can do to reproduce and capture the error.

sah62’s picture

Maybe 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?

salvis’s picture

installed the krumo library in sites/all/modules/devel

I'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.

sah62’s picture

Krumo is included with Devel, you should not do any separate step for this

When 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?

salvis’s picture

Yes, 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...

salvis’s picture

FileSize
18.03 KB

Here's a screenshot of what it looks like if I purposely add code that produces that error (there's admin_menu at the top):

 

(screenshot)

 

Your best bet is to use user 1.

sah62’s picture

FileSize
31.3 KB

Thanks, 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?

salvis’s picture

No, 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

      krumo($nicetrace);

near line 1830 and replace it with

      dpm($nicetrace);

This might help.

Thank you for pursuing this, I'm very interested in getting this resolved.

sah62’s picture

FileSize
105.7 KB

That made a difference - thanks! I've attached a picture of the trace with the arguments displayed.

So what might be broken with krumo?

salvis’s picture

Project: Mail Editor » Ubercart
Version: 7.x-1.0-alpha2 » 7.x-3.x-dev
Status: Postponed (maintainer needs more info) » Active

Thank 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.)

TR’s picture

Status: Active » Needs review
FileSize
2.25 KB

Try this patch and let me know if it solves the problem.

longwave’s picture

Status: Needs review » Fixed

Committed #12.

sah62’s picture

The 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!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.