Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#23 | omega-property_of_non_object_in_alpha_invoke_3.x-dev-1763362-22.patch | 1.24 KB | Anonymous (not verified) |
Comments
Comment #1
Simon Georges CreditAttribution: Simon Georges commentedIf 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.
Comment #2
Simon Georges CreditAttribution: Simon Georges commentedActually, 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.
Comment #3
Natsu- CreditAttribution: Natsu- commentedSame problem here in similar context.
Somebody has an idea ?
Comment #4
gaele CreditAttribution: gaele commentedComment #5
gaele CreditAttribution: gaele commentedSee also #1613562: Mail System breaks Omega based theme
Comment #6
gaele CreditAttribution: gaele commentedThis 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.
Comment #7
gaele CreditAttribution: gaele commentedComment #8
pingwin4egDrupal core Themes don't have theme_container classes.
try this patch and confirm please if your subtheme is picked up when building emails.
Comment #9
Simon Georges CreditAttribution: Simon Georges commentedIndeed, the patch works perfectly for me (the sub-theme is picked up when sending e-mails, and the error message is gone). Thanks!
Comment #10
berdyshev CreditAttribution: berdyshev commentedlooks good for me. I think patch in #8 can be committed.
Comment #11
gaele CreditAttribution: gaele commented+1
Thank you pingwin4eg.
Comment #12
juliusvaart CreditAttribution: juliusvaart commentedI can also confirm #8 is working. Thanks!
Kind regards,
Julius
Comment #13
nlisgo CreditAttribution: nlisgo commentedPatch #8 worked for me. Thanks.
Comment #14
Simon Georges CreditAttribution: Simon Georges commentedIs there something preventing this to be committed?
Comment #15
saccard CreditAttribution: saccard commentedI had the smae Problem and the Patch in #8 solved it without any side effect.
Comment #16
mudsurfer CreditAttribution: mudsurfer commentedHi, 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
Comment #17
Simon Georges CreditAttribution: Simon Georges commented@mudsurfer, no the patch has not been committed yet.
Comment #18
dazz CreditAttribution: dazz commentedStill a problem in 7.x-4.0
Comment #19
fubhy CreditAttribution: fubhy commentedHmm. 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.
Comment #20
nlisgo CreditAttribution: nlisgo commentedLet's get this pushed through on the appropriate version.
Comment #21
Anonymous (not verified) CreditAttribution: Anonymous commentedPatch for 3.1
Comment #23
Anonymous (not verified) CreditAttribution: Anonymous commentedPatch for 3.x-dev
Comment #24
gaele CreditAttribution: gaele commentedComment #25
markhalliwellThis 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.
Comment #26
fubhy CreditAttribution: fubhy commentedThanks for reporting back Mark
Comment #27
markhalliwellApparently 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.
Comment #28
joelpittet@Mark Carver does bootstrap have or need a fix issue as well?
Comment #29
markhalliwellNo. 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.