Had a weird bug where $existing_path = array_shift($theme_registry[$template]['theme paths']); was telling me it wasn't an array. Installed devel to dsm it and the error went away. Uninstalled devel and the error didn't come back. Bizarre.

Michelle

Comments

psicomante’s picture

only in 6.x-dev?

Michelle’s picture

I don't know. That's the version I saw it in.

Michelle

Michelle’s picture

Title: Bug when devel not installed? » theme_registry not defined when devel not installed

Confirmed bug as reported in #355191: warning: array_unshift()

Michelle

Anonymous’s picture

I have the same problem.

likewhoa’s picture

confirmed here with -dev on drupal 6.8.

Michelle’s picture

Ok, folks, it's obviously a bug. Really don't need more confirmation. I'll fix it when I have time.

Michelle

Michelle’s picture

Issue tags: +Release blocker
bcn’s picture

Status: Active » Needs review

I was getting this error (with Adv. Forum 6.x-1.0-unstable1 ), and after some debugging, I figured out that author pane was not installed... Obviously after installing author pane (latest dev) the error goes away.

Michelle’s picture

Title: theme_registry not defined when devel not installed » $theme_registry not an array
Status: Needs review » Active

Setting status back. There's no patch in #8. Also giving it a slightly better title since it seems to have nothing to do with devel but simply the act of installing a module fixes it. Unfortunately I didn't copy the exact error down because I wasn't expecting it to disappear when I installed devel to debug it. :(

Not sure when I'll get to this. Sorry, folks, but I'm getting paid at the moment to work on APK and AF is all on my own time which is non existant at the moment.

Michelle

dturover’s picture

I first experienced the same problem on upgrading advanced forums from alpha16 to unstable1 after upgrading core from 6.8 to 6.9. It showed up on the upgrade.php and also appears on the admin modules page. The problem is only semi-repeatable since the function advanced_forum_theme_registry_alter that triggers it is not always hit on a reload, but reload enough times and it will come back.

The problem occurs when $template='author_pane'. Compare to the successful result with an existing $template:

DEBUG: in template forum_submitted theme registry contains:
'template' => 'modules/forum/forum-submitted'
'arguments' => 'Array'
'type' => 'module'
'theme path' => 'modules/forum'
'theme paths' => 'Array'
'preprocess functions' => 'Array'

DEBUG: Done debugging.

DEBUG: in template author_pane theme registry contains:
'theme paths' => ''

DEBUG: Done debugging.

This is the case for both the shift and unshift errors.

I am having a similar issue with the new version in that the author pane does not appear in forum posts and comments, and this error appears:

warning: theme_render_template(./.tpl.php) [function.theme-render-template]: failed to open stream: No such file or directory in /Volumes/UpperController/faculty/csclub/public_html/includes/theme.inc on line 1012.

Both problems went away after installing and activating the author pane module as recommended by noahb.

Michelle’s picture

Well, you're definitely going to have problems if you don't install author pane. So let's eliminate that from the equation. What I'm trying to nail down is why this crops up when author pane is installed. Can anyone else repro that? I only hit it once on a new dev site and it disappeared when I installed devel to debug it. :(

Michelle

Michelle’s picture

Title: $theme_registry not an array » "argument should be an array" error when author pane not enabled
Status: Active » Fixed

Ok, I figured out what's going on. It is caused by author pane not being enabled after all. The reason I was confused is that author pane is a requirement of AF and therefore has to be enabled. And, for me, the error appeared to go away when I installed devel as I already had author pane installed. But what actually happened was that author pane was there but it doesn't get enabled automatically right away when you update AF. By enabling devel, I was resubmitting the module page which must have made it go "hey, wait a sec, I need that module". LOL

So, the short of it is that this bug happens when you don't have AP which normally should never happen. Because it evidentally can happen in this one circumstance, I put in an extra check to avoid errors.

Michelle

Michelle’s picture

Issue tags: -Release blocker

Status: Fixed » Closed (fixed)

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