When I enable the Internationalization module I get the following error message:
warning: array_merge() [function.array-merge]: Argument #2 is not an array in .../includes/theme.inc on line 930.
With lines 930 (and surrounding) of theme.inc having the following code:
922 if (module_exists('node')) {
923 foreach (node_get_types() as $type => $name) {
924 $defaults['toggle_node_info_'. $type] = 1;
925 }
926 }
927 $settings = array_merge($defaults, variable_get('theme_settings', array()));
928
929 if ($key) {
930 $settings = array_merge($settings, variable_get(str_replace('/', '_', 'theme_'. $key .'_settings'), array()));
931 }
932
933 // Only offer search box if search.module is enabled.
934 if (!module_exists('search') || !user_access('search content')) {
935 $settings['toggle_search'] = 0;
936 }
I have i18n v. 6.x-1.1 installed and am running Drupal 6.13. Is anybody else encountering this error? Any advice on how to correct it would be greatly appreciated.
Thanks.
Comments
Comment #1
gmreed commentedComment #2
jose reyero commentedIt may be any other module or wrong settings. Le us know whether you can reproduce this on a clean install with Drupal core + i18n.
Comment #3
gmreed commentedOkay, will do. Thanks.
Comment #4
joergvk commentedI can reproduce this in my setup that I created today. i18n ist the only contributed module present there. It is a multisite install and i18n resides in the sites/all/modules folder. Theme is Garland.
In my settings.php there is this:
If I remove the theme variables:
the warning goes away.
Comment #5
jeyroConfirming this error on a fresh install of v6.13 using only the i18n 6.x-1.1 module (internationalisation proper, only) and the needed core modules required to run it.
Error occurs when placing variable in the settings.php file before installation:
theme_garland_settings
(I have not used the theme_settings variable. Not sure if this happens with other themes or not.)
Comment #6
thoth commentedI am getting this error on a multilingual site I moved to a local apache installation for experimentation, and yet I get no errors on the live site. So I could work on both my local copy of the site, and the live site simultaneously I added a couple of letters at the end of the domain (i.e. www.example.com, and www.example.com.ns) stuck the new site name in my hosts file, used a text editor to replace all occurences of the domain in the sql backup of the site's db (i.e. vi -c "% s/www.example.com/www.example.com.ns/g" exampledb.sql ). And when running the site i get very similar errors as those aforementioned in this thread. Although, it's not vitally important to me as it is my experimental local install, I would like to figure it out and be able to move a site from domain to domain without manually changing every single link. Of note I also have a few i18n variables declared in my settings.php like my theme settings and a few others.
Comment #7
Marc Bijl commentedJust wanted to let know I got this error message too (warning: array_merge() [function.array-merge]: Argument #2 is not an array in .../includes/theme.inc on line 930), btw only when using Garland for admin theme.
After upgrading to the latest i18n module (1.2 from November 8th) the message just disappeared. Everything seems fine again.
Comment #8
jose reyero commentedOk, then I guess it was a bug, and it seems it's fixed.
Thanks.
Comment #10
jmullee commentedwarning: array_merge() [function.array-merge]: Argument #2 is not an array in /usr/share/drupal6/includes/theme.inc on line 978.
Drupal 6.16, 2010-03-03 (en)
modules : Devel, Views, Drupal-Facebook
PHP 5.2.6-3ubuntu4.5
the array_merge fn changed in PHP5 (should have been dealt with!!)
line 975 of /usr/share/drupal6/includes/theme.inc
---8<---
if ($key) {
$v = variable_get(str_replace('/', '_', 'theme_'. $key .'_settings'),array());
$settings = array_merge($settings, (array)$v);
}
---8<---
seems to work ..
Comment #11
Fogg commentedThanks! The fix from jmullee worked for me! Had the same problem with drupal 6.14 after upgrading some modules. I will try to get 6.16 up and running, however, on the first try I had issues with the gallery module.
Comment #12
pc_michael commentedI know this thread it pretty old, but I just wanted to add a simple solution that works for me. If the menu system works for a default theme like Garland but throws the array_merge() error for your custom theme, you just need to re-save your theme settings in Site Building > Themes > Configure > [Your Custom Theme]. Make sure you go through and set to display Primary and Secondary Links, etc. Once you save it again it seems to work.
Comment #13
patoshi commentedsame issue with:
warning: array_merge() [function.array-merge]: Argument #2 or #1
I got this error while doing dev to production migration and did some db edits whereby i had to update filepaths in the files table. i got the error after i tried to delete one of the image nodes. Issue is related to the theme layer.
Basic fix is just goto your theme settings and check off primary and secondary links again and just save it. it solved my issue. please post if this solution also helped you.
Comment #14
twooten commentedI can confirm that this works. I just went to my themes setting page and basically copied what I had checked and filled out on my dev site to my production site. Then hit save. I had to do that for the default garland theme and also for my custom theme. Once I did that, all was well again.
Thanks!
Comment #15
cybershan commentedthis solution works on for me, thanks.
Comment #16
danilocgsilva commentedIndeed, I got the same error just doing the edits (updating paths) on db. And also like duckx, checking and unckecking the links boxes also just does solve my problem. I only thing that should be clear that the links boxes in question is not those on the custom theme tab, but on the theme's global settings tab, at least for me.
See yah!
Comment #17
juroon commentedI'm not working with internationalization, but duckx's fix worked for me for the array error in an different context, where I was copying a D6 site to a collection of test sites, and where I also had a problem with file paths not updating.
I had tried everything else I could think of, including rebuilding node references, clearing all caches including views cache, flushing imagecache, checking the file path, exporting the MySQL db and searching and replacing the path then importing, swapping image kits, resaving views, themes, modules, content types, and what have you.
I had to enable the links in three places: the generic theme settings, the admin theme settings, and the public theme settings. Each seemed to have it's own set of array errors, all of which showed up on all pages, admin and public.
However, I it did not seem to work entirely on one of the three test sites I was creating. That is, it got rid of the array error messages, but I still had a lingering problem getting my image path to update to the new subdomain, which this fix took care of on the other tests. In the end, I took my test site out of maintenance mode and the images immediately began to work, and continued to work after I put it back into maintenance.
So, two morals to this story: 1) this fix works, and 2) if you still have trouble with file paths if you're changing a domain or subdomain name, try the site in live mode. It's easy to forget that maintenance mode should not be used for a development mode.
Comment #18
SamSteinig commentedI had the same problem, and this simple solution worked for me too. I just went into my theme configuration, hit save (actually had to do it twice) and all is good!