Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#46 | base-theme-notice-skinr-943782-46.patch | 1.36 KB | esclapes |
#45 | base-theme-notice-skinr-943782-45.patch | 684 bytes | esclapes |
#41 | skinr-__system_theme_data_notices-943782-41.patch | 4.02 KB | moonray |
#39 | skinr-943782-39.patch | 5.02 KB | moonray |
#31 | skinr-943782-31.patch | 987 bytes | Dane Powell |
Comments
Comment #1
JacineThanks for the report Melissa :D
I'll check it out.
Comment #2
JacineOk, 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.
Comment #3
JacineI'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:
$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.Comment #4
JacineI'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.
Comment #5
nomonstersinme CreditAttribution: nomonstersinme commentedI can verify there are no more notices with the above patch in 6.x-1.x dev
Comment #6
JacineThanks! Committed :)
http://drupal.org/cvs?commit=439966
Comment #7
Alexander Allen CreditAttribution: Alexander Allen commentedReopened. 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.
Comment #8
JacineIf 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.
Comment #9
Alexander Allen CreditAttribution: Alexander Allen commentedJacine,
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.
Comment #10
Alexander Allen CreditAttribution: Alexander Allen commentedWill post patch.
Comment #11
Alexander Allen CreditAttribution: Alexander Allen commentedSubstituted 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.
Comment #12
JacineAs 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?
Comment #13
Alexander Allen CreditAttribution: Alexander Allen commentedJacine,
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.
Comment #14
Alexander Allen CreditAttribution: Alexander Allen commentedAccidentally changed status, changed back to needs review. Sorry.
Comment #15
Alexander Allen CreditAttribution: Alexander Allen commentedI 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.
Comment #16
moonray CreditAttribution: moonray commentedComment #17
rfayFrom #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.
Comment #18
JacineOk, 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.
Comment #19
JacineComment #20
Alexander Allen CreditAttribution: Alexander Allen commentedWhat 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?
Comment #21
WorldFallz CreditAttribution: WorldFallz commentedI 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).
Comment #22
jpw1116 CreditAttribution: jpw1116 commentedI 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.
Comment #23
esod CreditAttribution: esod commentedThanks for addressing the issue. The patch in #17 made the notices go away on my site that uses skinr and Acquia Prosper.
Comment #24
ChrisBryant CreditAttribution: ChrisBryant commentedIt 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.)
Comment #25
sunThanks to Jacine's analysis in #18, the solution is simple:
Comment #26
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedWhy don't we do a check before calling
system_find_base_themes()
?The following code change fixed the issue for me.
Comment #27
verta CreditAttribution: verta commentedsubscribing
Comment #28
tribe_of_dan CreditAttribution: tribe_of_dan commentedSub
Comment #29
polishyourimage CreditAttribution: polishyourimage commentedSub
Comment #30
Dane Powell CreditAttribution: Dane Powell commentedI 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.
Comment #31
Dane Powell CreditAttribution: Dane Powell commentedA patch with fix in 26, if it helps...
Comment #32
alberto56 CreditAttribution: alberto56 commentedSubscribing. The error I'm getting is "notice: Undefined index: base theme in [...]/modules/system/system.module on line 947"
Comment #33
mbannach CreditAttribution: mbannach commentedsubscribing
Comment #34
Dane Powell CreditAttribution: Dane Powell commentedI suppose #31 could use review
Comment #35
drupizzle CreditAttribution: drupizzle commented#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
Comment #36
John Franklin CreditAttribution: John Franklin commentedPatch 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.
Comment #37
moonray CreditAttribution: moonray commentedWhat about the suggestion in #25, though? We wouldn't need to use a private function, if that fixes the problems.
Comment #39
moonray CreditAttribution: moonray commentedThis patch uses the concept from #25. It reverts to using system_theme_data() instead of the private function _system_theme_data() and avoids callingthe function while running update.php.
We're applying to the 2.x branch first, then backporting.
Comment #41
moonray CreditAttribution: moonray commentedNow for the 1.x branch fix.
Comment #43
moonray CreditAttribution: moonray commentedDone. Please reopen if still an issue.
Comment #45
esclapes CreditAttribution: esclapes commentedI am afraid the reported notice:
Notice: Undefined index: base theme in system_find_base_themes()
was not fixed.system_find_base_themes
expects the second argument (in our case$data['current_theme']
) to be a theme name with a base theme defined in its .info file.The simplest fix is to check if this is set before calling
system_find_base_themes
Find a patch for 1.x attached.Comment #46
esclapes CreditAttribution: esclapes commentedFound another php notice:
Undefined variable: $current_theme
that can be easily fixed so I just replaced the undefined variable with$data['current_path']
which is defined.This patch includes the changes on #45
Comment #48
moonray CreditAttribution: moonray at Chapter Three commentedI had to tweak the patch, but the parts that weren't already in are no committed.