Posted by Melissamcewen on October 16, 2010 at 11:36pm
20 followers
| Project: | Skinr |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Alexander Allen |
| Status: | reviewed & tested by the community |
Issue Summary
I'm getting:
# Notice: Undefined index: base theme in system_find_base_themes() (line 942 of [SITEURL]/modules/system/system.module).
which goes away when I disable skinr
Comments
#1
Thanks for the report Melissa :D
I'll check it out.
#2
Ok, I can easily reproduce this with using any theme (whether it has a base theme or not). There are also a quite a 2 other issues I'm seeing:
notice: Undefined variable: skinr in /Users/jacine/Sites/drupal-6/sites/all/themes/skinr_one/page.tpl.php on line 94.Yes, this is technically the theme, but we can prevent it, so we should.
notice: Undefined index: preprocess_hook in /Users/jacine/Sites/drupal-6/sites/skinr-1.x/modules/skinr/skinr.module on line 111.Getting this when editing panels panes/regions.
#3
I've got fixes for the notices in #2, but I can't seem to figure out how to fix the base themes issue.
It's only happening when there is not a base theme, and this line is the problem:
<?php$themes = array_keys(system_find_base_themes(_system_theme_data(), $current_theme));
?>
I assume the issue is that since
system_find_base_themes()is returning NULL, trying to do the array_keys() part is throwing a notice? Nothing I've tried so far as fixed it yet.#4
I've attached the fixes for the notices mentioned in #2, but I think the "base themes" issue is a core bug. We need that code, and there doesn't appear to be any way to prevent the notice. Luckily this is a very minor issue, as these should never display on any live site. Drupal core prevents them from displaying entirely, and you need to specifically hack core, from my experience to make them appear.
#5
I can verify there are no more notices with the above patch in 6.x-1.x dev
#6
Thanks! Committed :)
http://drupal.org/cvs?commit=439966
#7
Reopened. I'm getting the same problem, but on version 1.5
Undefined index: base theme in system_find_base_themes() (line 942 of ..modules/system/system.module.Trying to replace line 942 with the one found on the patch didn't work either.
#8
If you have a fix for this, feel free to post a patch. Otherwise, please see comment #2.
Marking "wont fix" but it really should be "can't fix."
EDIT: err, comment #4, not #2.
#9
Jacine,
I would consider this is a core bug as well. I replicated the error while having Garland enabled.
See: http://skitch.com/richard-alexander-allen/d7gpt/943782-skinr
The only thing it occurs to me to prevent the error is to do our own implementation of function system_find_base_themes in skinr.
#10
Will post patch.
#11
Substituted system_find_base_themes with skinr_find_base_themes on function skinr_preprocess. This eliminated the error found in the bug description and comment #9.
#12
As far as I know, skinr_find_base_themes() does not work properly (for what Skinr needs it to do), which is why it's not being used.
@moonray Can you please look into this?
#13
Jacine,
skinr_find_base_themes is a copy I made of system_find_base_themes (and attached it in the patch). It did solve the error I screen-grabbed on comment #9. Patch in comment #4 didn't solve the issue on comment #9, since I am working off the dev version. If I revert my patch for example, the error on comment #9 comes back up. DM if you have any further questions.
Thank you.
#14
Accidentally changed status, changed back to needs review. Sorry.
#15
I just found out that my changes, for some reason I don't know, force Panels 3.7 into legacy mode (like described in issue http://drupal.org/node/866184).
Reverting the patch make the errors in #9 (and #2) return, but take Panels out of legacy mode (no warning message on the module status page).
I'll give another shot to trying fixing this.
#16
#17
From #981210: Warning messages from skinr if a theme that does not have a base theme is in use...
Isn't this enough to fix this?
I'm not really following the issue, nor a skinr user, so just had to figure out why my sandbox was outputting warnings.
#18
Ok, well here's a couple of things about this:
1 - It happens when using Skinr on a regular theme. If you are using a subtheme, you get no notices.
2 - We were using
system_theme_data()initially, but changed to_system_theme_data()in this commit in an attempt to try and fix this issue #581604: skinr disable the active theme.@moonrays comment at the time was:
So, I don't know what's better: Notices or themes constantly being disabled on update, but apparently people are still running into the core bug. The nature of this problem is pretty serious, as Skinr NEEDS an active theme to function, which is why I would probably stick with the notices. But, apparently people are still running into that problem anyway.
#19
#20
What would prevent us from copying the contents of _system_theme_data() into a new function called skiner_system_theme_data() and using that instead? Would that disable the notices and the update problem?
#21
I tried the patch in 17, and it does indeed fix the problem. While the notice might seem like just an annoyance, they make it very painful when trying to troubleshoot anything else.
I also don't understand why the patch can't be used-- if there are no base themes you'll always get at least one theme (the $current_theme).
#22
I just wanted to chime in that I've never used anything other than D7 and, with Skinr 7.x-2.x-dev enabled and Fusion core as my default theme, also get the notice "Undefined index: base theme in system_find_base_themes()."
Of course, setting the default theme to Fusion starter seems to remove the notice . . . but in the interest of any newbies setting Fusion core as the default, they will be seeing red.
#23
Thanks for addressing the issue. The patch in #17 made the notices go away on my site that uses skinr and Acquia Prosper.
#24
It seems like rfay's patch in #17 can be set to RTBC based on comments #21 & 23 unless moonray or Jacine have any reasons not to (or if it's still won't/can't fix because of the core bug.)
#25
Thanks to Jacine's analysis in #18, the solution is simple:
if (defined('MAINTENANCE_MODE')) {return;
}
#26
Why don't we do a check before calling
system_find_base_themes()?The following code change fixed the issue for me.
+ $themes = array();// Add any base themes.
- $themes = array_keys(system_find_base_themes(_system_theme_data(), $current_theme));
+ $system_theme_data = _system_theme_data();
+ if (isset($system_theme_data[$current_theme]->info['base theme'])) {
+ $themes = array_keys(system_find_base_themes($system_theme_data, $current_theme));
+ }
#27
subscribing
#28
Sub
#29
Sub
#30
I got the same error when I migrated my site from stock Drupal to Pressflow, presumably because Skinr is using a private function (
_system_theme_data()).Applying the fix in #26 eliminated the error.
#31
A patch with fix in 26, if it helps...
#32
Subscribing. The error I'm getting is "notice: Undefined index: base theme in [...]/modules/system/system.module on line 947"
#33
subscribing
#34
I suppose #31 could use review
#35
#26 worked for me as well. In case anybody has a similar issue I'm running Merucury Pantheon stack on Linode. Mercury, Varnish, Memcache, Pressflow 6
#36
Patch file from #31 (a.k.a. the #26 fix) fixed a problem here, too. In particular, I was seeing it with Seven as the admin theme. Three "me, too" posts earns this the RTBC badge.
#37
What about the suggestion in #25, though? We wouldn't need to use a private function, if that fixes the problems.