This module crashes the website when the front_page module is installed and the cache support is enabled. This happens when the user logs out of drupal and the cache takes over.
It gives the follow error:
Fatal error: Call to undefined function: t() in /home/minglr/public_html/modules/hof/hof.module on line 178
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | hof.module | 21.21 KB | syscrusher |
Comments
Comment #1
syscrusher commentedThanks for reporting the bug. It appears that t() is not yet defined in hook_init() if cache is being used. Since I didn't need the result of that particular call until later anyway, I moved it into the page generation code. I've tested this with anonymous access on my local site, and it works here. Please test, and report back whether this fixes the problem for you.
I haven't committed this to CVS yet, pending your test report.
Note that the attachment is a replacement for hof.module, not just a diff.
Scott
Comment #2
sami_k commentedThanks Scott, great module btw. Now when I replaced the module with your code with the cache disabled I get this:
Regards,
Sami
Comment #3
syscrusher commentedWell, the module is only 463 lines long, so if you're getting an error from "line 465", there is an extremely good chance that you accidentally inserted some blank lines after the PHP closing tag ?> at the end. Please check for that, and delete any blank lines you find at the end of the module. Let me know if this doesn't fix the problem. There's definitely something wrong with your copy, because the canonical version here is 463 lines long.
Scott
Comment #4
syscrusher commentedGAAAAK! The file I attached to my previous post renders as HTML when you click on it. I'm not sure what I did wrong, but I'll go ahead and commit the update to CVS instead. Don't download the previous version (it's okay to view it, of course). Sorry.
Scott
Comment #5
sami_k commentedThe CVS doesn't seem to be committed as of yet, it's still giving the error.
Comment #6
syscrusher commentedYou must have gotten in really quickly -- CVS was updated just a few minutes after my last post, for 4.5, 4.6, and HEAD. Please try again. The indication that you have the right module is seeing _hof_constants() called from inside hof_page().
Comment #7
sami_k commentedTwo thumbs up, thank you! It works with both cache on and off.
Sami
Comment #8
(not verified) commented