This is a weird one, and I'm hard-pressed to reproduce it, but regardless of cause and effect, the attached patch should be committed anyways, to make the generated $prefixes array structure similar to that returned by module_list().

In d6_compat.inc, you define the default preprocess function, $prefixes[] = 'template';, which will eventually map to template_preprocess_forum() (same file). However, because you define it without an array index, it gets stored as: [0] => 'template'. You then add all the modules to the list via module_list(). That function sets modules as ['block'] => ['block']. At the very least, the attached patch will set 'template' to be list the rest of the modules.

However, I think there's also a bug here that recently bit my site (where we ended up truncating the cache, which called a recreation of this preprocess function list). After adding 'template' and all the modules to the $prefixes, you run through a blacklist routine to remove 'search' from the lookup. You end up doing this great foreach with an array_search and all this crap (when you could simply do unset($prefixes['search']), which would also be another legitimate fix/patch). When search.module isn't enabled (and thus, not returned in module_list), array_search() will return FALSE. The code, however, blindly will attempt to unset [$prefixes[FALSE]], which I BELIEVE kills off [0] => 'template'. Removing 'template' from the prefixes list breaks the entire module (since template_preprocess_forums is never run).

Ahem.

Nutshell? Apply this patch ;)

CommentFileSizeAuthor
#4 d6_compat.txt15.79 KBmichelle
_preprocess_cache.patch1.08 KBmorbus iff

Comments

morbus iff’s picture

Status: Active » Needs review
michelle’s picture

Title: d5 preprocess: 'template' definition can cause oddness » Preprocess bug causes forums to not show up
Status: Needs review » Reviewed & tested by the community

Having just gotten bit by this and spending an hour trying to track it down before suddenly -- duh! -- remembering Morbus had already fixed it, I can attest this is totally RTBC and will be first on the list the next time I work on AF.

If you are having problems with the forums not showing up in alpha 13, try this patch. Changing the title so people can find it easier.

Michelle

lismail’s picture

Hi Morbus,
This patch works.

Thanks alot.

Lucky

michelle’s picture

Priority: Normal » Critical
StatusFileSize
new15.79 KB

Because this is a rather critical bug and the next alpha is a ways off, I'm attaching the patched file here as well. Change .txt to .inc.

Michelle

michelle’s picture

Status: Reviewed & tested by the community » Fixed

Committed, finally, thanks. :)

Michelle

mouse77e’s picture

This thread is for 5.x-1.x-dev but the patch says D6...? which is it for?

michelle’s picture

It's for 5.x. The patch is for the d6_compat file.

Michelle

mouse77e’s picture

Can someone PLEASE send me a copy of the patched module as i am not in a position to do the patching myself - i am running my site from a netbook at the moment /////// PLEASE \\\\\\\

michelle’s picture

Status: Fixed » Closed (fixed)

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