Hi,

When sending an e-mail as an administrator (using the administrator theme) wanting to use another (Omega-based) theme to send the e-mail, the following notices appear:

Notice : Trying to get property of non-object dans alpha_invoke() (ligne 99 dans /var/www/chais_oeuvre/www/sites/all/themes/omega/alpha/includes/alpha.inc).
Warning : Invalid argument supplied for foreach() dans alpha_invoke() (ligne 99 dans /var/www/chais_oeuvre/www/sites/all/themes/omega/alpha/includes/alpha.inc)

I'm not sure if it directly concerns Omega or if Mail System could be implicated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Simon Georges’s picture

Status: Active » Needs review
FileSize
706 bytes

If I remove the following code, it works, but I suspect there's a reason for it to be here, so I'm wondering if you have a better proposal for it.

Simon Georges’s picture

Status: Needs review » Active

Actually, when doing that, Omega is included, but Alpha isn't, therefore nothing works on my theme any more... So it isn't at all a patch you want to use.

Natsu-’s picture

Same problem here in similar context.
Somebody has an idea ?

gaele’s picture

Category: support » bug
gaele’s picture

gaele’s picture

Title: Notices when using Omega sub-theme » Notices when using Omega sub-theme with Mail System module
Project: Mail System » Omega
Version: 7.x-2.x-dev » 7.x-3.x-dev
Component: Module compatibility » Code

This seems to be an Omega bug.

I tried this with an Omega sub-theme, Mail System and Simplenews. "Theme to render the emails" is set to the Omega sub-theme.

The problem is in alpha_get_theme(). The moment the mail is composed $GLOBALS['theme_key'] is "seven" (the administrator theme), so alpha_get_theme() returns nothing.

gaele’s picture

Title: Notices when using Omega sub-theme with Mail System module » Omega does not work with Mail System module
pingwin4eg’s picture

Status: Active » Needs review
FileSize
1.24 KB

Drupal core Themes don't have theme_container classes.
try this patch and confirm please if your subtheme is picked up when building emails.

Simon Georges’s picture

Indeed, the patch works perfectly for me (the sub-theme is picked up when sending e-mails, and the error message is gone). Thanks!

berdyshev’s picture

Status: Needs review » Reviewed & tested by the community

looks good for me. I think patch in #8 can be committed.

gaele’s picture

+1
Thank you pingwin4eg.

juliusvaart’s picture

I can also confirm #8 is working. Thanks!

Kind regards,

Julius

nlisgo’s picture

Patch #8 worked for me. Thanks.

Simon Georges’s picture

Is there something preventing this to be committed?

saccard’s picture

I had the smae Problem and the Patch in #8 solved it without any side effect.

mudsurfer’s picture

Hi, has this patch made it into the latest dev version?

I have manually applied the patch from #8 and looks good to me.
core 7.21
mailsystem 7.x-2.4
simplenews 7.x-1.0
SMTP 7.x-1.0
Mime Mail 7.x-1.0-alpha2
omega 7.x-3.1

Simon Georges’s picture

@mudsurfer, no the patch has not been committed yet.

dazz’s picture

Version: 7.x-3.x-dev » 7.x-4.0

Still a problem in 7.x-4.0

fubhy’s picture

Hmm. Can you elaborate further on how this is still a problem in 4.x? The function that is targeted by the patch from this issue does not even exist anymore. In fact, the entire system that this patch targets does not exist anymore.

nlisgo’s picture

Version: 7.x-4.0 » 7.x-3.x-dev

Let's get this pushed through on the appropriate version.

Anonymous’s picture

Status: Reviewed & tested by the community » Needs work
Anonymous’s picture

gaele’s picture

Status: Needs work » Needs review
markhalliwell’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#2051135: Mail System breaks theme registry

This isn't an Omega issue. The same thing has happened in Bootstrap. It's a bug in Mail System.

See patch in #2051135-3: Mail System breaks theme registry.

fubhy’s picture

Thanks for reporting back Mark

markhalliwell’s picture

Status: Closed (duplicate) » Needs review

Apparently this is still an issue (even though that issue has a "semi" fix). Re-opening to be addressed here and to stop unnecessary chatter on other issue.

joelpittet’s picture

@Mark Carver does bootstrap have or need a fix issue as well?

markhalliwell’s picture

No. The patch in the related issue technically "works" with Bootstrap based themes. @plach (who posted the patch) and I found that issue when we worked on the same Bootstrap based project. In all reality this issue shouldn't be needed though. The only reason I opened this back up is because the other issue is/was being inundated with comments that really pertained to this issue and nothing with actually fixing the other. So given the amount of "it doesn't work with omega" comments on the other, I am assuming that patch still doesn't fix this issue.

However, the real culprit (bug) is the mail system module (the patch in that issue is just a stopgap measure). It's still doing some really hacky stuff with the theme registry and ultimately an entirely different solution needs to be worked out so it works with all base themes.

This is why, BTW, I said the other issue was CNW and not "fixed/active" to backport that patch. I talked with @Fabianx though and we discussed that even a temporary fix is better than no fix at all, which is why it got moved back to backport status. I just don't have time to step through the intricacies of the mail system module to figure out what it's doing and provide a better solution.