On going rtomy new instalation of Drupal (It worked yesterday)

* warning: array_map() [function.array-map]: Argument #2 should be an array in C:\Inetpub\vhosts\climatecalm.org\httpdocs\drupal\modules\system\system.module on line 966.
* warning: array_keys() [function.array-keys]: The first argument should be an array in C:\Inetpub\vhosts\climatecalm.org\httpdocs\drupal\includes\theme.inc on line 1760.
* warning: Invalid argument supplied for foreach() in C:\Inetpub\vhosts\climatecalm.org\httpdocs\drupal\includes\theme.inc on line 1760.

I have searched but cannot find any useful help. Does anyone know what s happening

Comments

cog.rusty’s picture

Are you using a custom theme? Is it Drupal 6 compatible?
If you have any regions[] in your theme's theme-name.info file, make sure that they are correct.

If you find a problem in one of your active themes and fix it, them visit the admin/build/modules page and let it load.

gleble’s picture

I was but I've removed my custom modules and themes but it doesn't help. You can see the offending site at http//:climatecalm.org/drupal
I cannot get to my admin, it says 'page not found' if I enter http//:climatecalm.org/drupal/admin How can I change the theme using code?

cog.rusty’s picture

Make sure that you haven't removed or moved any core themes from /themes

Go to http://climatecalm.org/drupal/?q=user to login with your user 1 account.
Then visit the http://climatecalm.org/drupal/?q=admin/build/modules page and let it load.
Them go to http://climatecalm.org/drupal/?q=admin/build/themes and select a theme.

If you have modifying anything in .htaccess or settings.php, undo it.

gleble’s picture

No, I only removed custom themes and modules. I cannot go to http://climatecalm.org/drupal/?q=user , I cannot go to http://climatecalm.org/drupal/anything I get 'page not found.

cog.rusty’s picture

But I just did go to http://climatecalm.org/drupal/?q=user and saw your login form.

I also saw that your menu links include "index.php", which they normally don't, and that is why I assumed that you have modified some of the configuration files.

gleble’s picture

Logged in on another machine and was able to select a theme which solved the problem. Couldn'tdo that on my machine, maybe coz I was already logged in. Thanks

picardo’s picture

I am using a theme called Acquia Marina. It's Drupal 6 compatible. I added a region to it during development and also added it into the info file:

regions[header_bottom] = header bottom

I didn't touch anything else. So I don't know what could be wrong. What else can I do?

btw, when I go to site maintenance and turn the site offline, and then back on again, the issue is resolved, but only for a while. After a couple of days, it comes back again.

snorkers’s picture

Getting same type of error - have been unable to change out of current theme (custom subtheme based on Blueprint) and get following in D6.13, if I remove my default (custom) theme, yet know that a different, valid theme is set [in MySQL]:

warning: array_map() [function.array-map]: Argument #2 should be an array in *PATH_TO_DRUPAL*/modules/system/system.module on line 966.
warning: array_keys() [function.array-keys]: The first argument should be an array in *PATH_TO_DRUPAL*/includes/theme.inc on line 1771.
warning: Invalid argument supplied for foreach() in *PATH_TO_DRUPAL*/includes/theme.inc on line 1771.

Toggled between using separate admin theme, then back to default: no effect
Tried switching to Garland*: no effect
Downloaded Acquia Marina*: no effect
Disabled all themes except one (to see if user-selected theme had any influence): no effect
Deleted custom theme: just have site rendered with system CSS and still cannot effect change of theme - ultimately resulted in above error

So I had a look in MySQL tables. When I switched default theme, MySQL actually records the selected theme I wanted in variable>theme_default (examples are *), but my site does not render the switch. The admin/build/themes page shows either my custom theme as selected (or none selected at all after deleting theme), even if a different theme is set to default in the MySQL tables.

I've been disabling modules left-right-and-centre but this is not helping (Sections was my first guess, but that had no effect; a little worried that OG is the culprit, but that's kind of essential to my current project). I had noticed that changing the theme used by the OG (mysql og>og_theme) works as expected, and I can have a separate Admin theme running... but then changes to Blocks are not reflected in the default theme. *aaaargh* (BTW I have flushed caches MILLIONS of times).

So I'm now completely stuck. I think it could be related to contrib modules not implementing hook_init() properly (see #219910), which is an "unsupported feature" of D6.

So is there any clue as to what is preventing this?

cog.rusty’s picture

A few things to check:

- Make sure that you have not added a $conf[] line in your settings.php file which forces a particular theme and ignores the database settings.
- In the admin/build/themes page, make sure that all the themes which you are using (admin or other) are enabled (the square check box).
- In admin/build/themes again, click the "configure" link of your enabled themes, then scroll down and click "Reset to defaults" for each enabled theme.
- Before setting up blocks in the admin/build/block page, make sure that you have selected the correct theme at the top of the page. Block settings are different for each enabled theme.

snorkers’s picture

@cog.rusty

Superstar! Must have set the theme in settings.php months ago (trying to keep the site design tight) and completely forgot about $conf[]... this is probably why I'd been in block hell for ages too. Despite selecting the correct theme at top of the blocks page, it wasn't having any impact.

I think I'd set the default theme, when I adjusted the maintenance theme in settings.php to 'un-drupalize' the site when offline/in maintenance mode. Seemed look a good idea at the time.

*relax*

Kudrixa’s picture

I'm just wondering if you ever found your custom theme. This just happened to me and my tweaked Acquia Marina theme is no longer being "seen" by the site. I am able to view everything in another theme, but that one is gone!

maxlee’s picture

Any guidance would be much appreciated.

I uploaded a site to from a wamp server on my pc to a shared linux host server last week. The site had been placed in off-line maintenance mode and I had switched from the acquia marina contributed theme to garland prior to using fire ftp to upload the site. After upload, the site displays no theme and for the past week, I have been receiving the following message:

* warning: array_map() [function.array-map]: Argument #2 should be an array in /home2/marketi7/public_html/bestmerchantcards/modules/system/system.module on line 966.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home2/marketi7/public_html/bestmerchantcards/includes/theme.inc on line 1771.
* warning: Invalid argument supplied for foreach() in /home2/marketi7/public_html/bestmerchantcards/includes/theme.inc on line 1771.

I can access the admin section but when I go to the admin/build/themes page, none of the standard or custom themes that I installed are there. The only choices are config or default, and I have tried both to no effect. I have also reviewed the settings.php file and there does not seem to be any change to the config settings.

Any help or insight would be much appreciated.

cog.rusty’s picture

Assuming that it is Drupal 6.

If you don't see any themes in the admin/build/themes page then go to the "/home2/marketi7/public_html/bestmerchantcards/themes" directory using FTP:
- Make sure that the "themes" directory has all lowercase letters and contains a "garland" subdirectory.
- Check the permissions of the "themes" and "themes/garland" directories to see if they are at least 755.
- Enter the "garland" subdirectory and check if it contains a "garland.info" file, with non-zero length and with permissions at least 644.

Also:
- Visit the admin/build/modules page and let it load, to update the paths of all themes and modules.
- Browse to update.php and let it run (even if there are no updates).

I am also assuming that you already tried the other suggestions discussed in this thread.

maxlee’s picture

Thank you. This was a really dumb oversight, but for some reason the entire themes folder was not loaded on the server when I ftp'ed the site from wamp.

In any case, the garland and other standard themes are available now, but none of the contributed modules or the acquia marina theme I have uploaded are visible from the admin pages. I have run cron, update.php, and also tried resetting the admin/build/themes/settings to default to no effect.

Any help or insight would be much appreciated.

Again, thanks for getting me this far.

cog.rusty’s picture

Where do you have your modules and themes? Are they under sites/all/modules/ and sites/all/themes?

maxlee’s picture

Yes exactly. Modules are located in site/all/modules and themes are located in sites/all/themes. Any ideas of what to try next?

PauvreFou’s picture

Hi,

I had exactly the same problem. I developped my website on Windows, using Wampserver. Everything worked fine until I upload the site on another server.

Actually, my modules and themes were located in sites/all/Modules/ and sites/all/Themes instead of sites/all/modules/ and sites/all/themes. It does not cause any problem on windows, but if the server runs Linux, then the path is case sensitive, so the folders modules and themes are not found when Drupal asks for them.

Hope it helps,

Etienne

mastermint’s picture

I've got the same errors.
So I made a remote system reboot on my server and all works again without problems.

g33kgirl’s picture

I just wanted to add that I had this issue come up today, although my situation was different, I had gotten my site up and running and was able to search the forums for answers to all that had come up,but did a backup of my site to restore to reset the ftp upload limits set by my webhost. Although this was at their suggestion, it failed and I had to completely start over, as any attempt to re-upload the site, even after having deleted all previously uploaded files, failed and gave errors to the point it was EASIER to start over. After a fresh install, I got the above named error, and clicking on the 'enable' box next to each theme and resetting to defaults worked perfectly. I have 3 other sites lined up to complete after I have all the bugs worked out of mine, and I have to say that this online community has been the best resource I could ever ask for! Thank you so much!!

logicalpat’s picture

I seem to be getting this same issue periodically using Drupal 6.13 with a Zen subtheme I created. I can't figure out what's causing it but randomly the site will "lose" the theme and if I go to admin/build/themes the theme comes back however the subtheme I was running doesn't have a check in the "Enabled" column.

I added a bug report to the Drupal Issues Queue about this here: #578144: Main theme lost

Jazzthedog’s picture

I had the same issue with Drupal 6.12 and having vertical_tabs and the Admin module running at the same time. I was actually fine until I added the Vertical_tabs module. So, this is "theme/layout" related type of problem.

Only until I disabled the Admin module did this error magically go away.

jelo’s picture

Subscribed

schtebo’s picture

i got same error massage

i solved it

1) opened homepage (got error message)
2) go to: http://example.com/update
3) updated database
4) worked :-)
5) still confused ... but happy ;-)

seems that this is a problem with other theme or captcha??

dpatte’s picture

Solution:
I went to my site
I logged in
I went to mysite/admin
at this point the site appeared normal again!
I when to themes and saved it.

Before this all happened i had noticed that my site lost connection to the database unexpectly. maybe something got coruppted at that point?

anonymous07’s picture

Subscribe

kristi wachter’s picture

For me, this was caused by the bug that causes all themes to be disabled. It appears to sometimes be triggered by update.php and sometimes by cron.

It was (in my case) easy to fix:

* go to your Themes page ( www.example.com/admin/build/themes )

* notice that, while one theme is selected as the default theme, NO themes are actually enabled

* re-enable your default theme (and any others you wish to enable)

* click Submit

˚ ˚ ˚ ˚ ˚
Kristi Wachter
Drupal consultant, evangelist, and enthusiast

glass.dimly’s picture

Drupal disabled my theme because the enabled theme folder was missing. After re-adding the folder, I had to re-enable it at admin/build/themes.