I'm seeing a caching issue when used with Icon API 7.x-1.0.

Under some circumstances, bootstrap icons just vanish and this is because wrong values get into the icon api cache, as bootstrap_icon_bundles() return an empty array, but I think it is actually an issue with this theme.

To reproduce it:

0. Bootstrap theme enabled, but using some admin theme not bootstrap based.
1. drush cc all
2. Right after that visit the Icons administration page. (Admin / Configuration / Media / Icons).
3. Click save... Glyphicons gone.

I traced it to bootstrap_icon_bundles() returning nothing since it depends on _bootstrap_glyphicons_supported(), just because the current theme (the admin theme, not bootstrap) doesn't support glyphicons - which is right, but the value -no glyphicons- is cached for every other theme -no glyphicons either.

So I think that '_icon_bundles()' hook shouldn't depend on the current theme. As Icon API uses it, it just should only return information about the library, that later can be used or not with other specific themes, but not about the current theme (which is usually the admin theme) supporting it or not.

Patch will follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jose Reyero created an issue. See original summary.

Jose Reyero’s picture

Status: Active » Needs review
FileSize
1.19 KB

This is a simple patch that just removes _bootstrap_glyphicons_supported() condition from bootstrap_icon_bundles().

Status: Needs review » Needs work

The last submitted patch, 2: bootstrap-icon-bundles-2974394-1.patch, failed testing. View results

markhalliwell’s picture

Patch has to be relative to the project, not your site.

Jose Reyero’s picture

Status: Needs work » Needs review
FileSize
1.06 KB

Fixed patch, relative to the project (against 7.x-3.20 though, hope it still applies)

markhalliwell’s picture

Version: 7.x-3.20 » 7.x-3.x-dev
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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