t() function can't be invoked in hook_boot() - patch supplied
greg.harvey - October 24, 2008 - 13:32
| Project: | Shared Sign-On |
| Version: | 6.x-1.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Jump to:
Description
Please find attached a patch to fix the issue where a PHP fatal error is caused by line 170 of this module if someone attempts a hack. The developer attempts to wrap the message in the t() function, but it cannot be guaranteed available as the bootstrap order is arbitrary. If it is not available, a fatal error is caused. Easiest fix, don't wrap it in the t() function! =)
| Attachment | Size |
|---|---|
| singlesignon_boot_t_patch-20081024.patch | 526 bytes |

#1
Actually, correction - t() is core, so bootstrap is not the issue - rather using hook_boot() as opposed to hook_init(). Totally get why you do that, you *MUST* use hook_boot() but it means t() is not available because nothing has been initialised at that point.
#2
#3
and this, can it be reviewed / applied?