If the admin theme isn't set to Bootstrap and the fonts haven't been downloaded from Bootstrap and added into the theme directory, the glyphicons are not made available through the Icon API.

The issue appears to be with using global $theme instead of specifying bootstrap directly. Patch attached.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

markhalliwell’s picture

Issue summary: View changes
Status: Needs review » Needs work

Instead of using global $theme, we should instead probably use $theme = variable_get('theme_default', $GLOBALS['theme']);, the rest of the if statement is fine though. We cannot limit this to the base theme, it has to be per theme basis.

geodaniel’s picture

Status: Needs work » Needs review
FileSize
822 bytes

That makes sense. Presumably the bootstrap files would still be in the bootstrap directory itself, it's just the CDN setting that needs to be controllable by the sub theme.

Updated patch attached.

markhalliwell’s picture

Status: Needs review » Needs work
+++ b/theme/icons.inc
@@ -21,10 +21,10 @@ function bootstrap_icon_providers() {
-  if ($cdn || (!$cdn && file_exists(drupal_get_path('theme', $theme) . '/bootstrap/fonts/glyphicons-halflings-regular.ttf'))) {
+  if ($cdn || (!$cdn && file_exists(drupal_get_path('theme', 'bootstrap') . '/bootstrap/fonts/glyphicons-halflings-regular.ttf'))) {

This still shouldn't change.

markhalliwell’s picture

Status: Needs work » Fixed

Thanks @geodaniel! Just went ahead and made that small change for you.

Committed c4dc942 to 7.x-3.x:

Issue #2120479 by geodaniel: Icon API support does not work if admin theme is not Bootstrap and fonts not downloaded.

Status: Fixed » Closed (fixed)

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