FIX: prevents SvgSprite.bundle to query ThemeField two times (#9762)
This commit is contained in:
parent
d69263f934
commit
9b85e75937
|
@ -209,6 +209,7 @@ module SvgSprite
|
||||||
THEME_SPRITE_VAR_NAME = "icons-sprite"
|
THEME_SPRITE_VAR_NAME = "icons-sprite"
|
||||||
|
|
||||||
def self.custom_svg_sprites(theme_ids = [])
|
def self.custom_svg_sprites(theme_ids = [])
|
||||||
|
get_set_cache("custom_svg_sprites_#{Theme.transform_ids(theme_ids).join(',')}") do
|
||||||
custom_sprite_paths = Dir.glob("#{Rails.root}/plugins/*/svg-icons/*.svg")
|
custom_sprite_paths = Dir.glob("#{Rails.root}/plugins/*/svg-icons/*.svg")
|
||||||
|
|
||||||
ThemeField.where(type_id: ThemeField.types[:theme_upload_var], name: THEME_SPRITE_VAR_NAME, theme_id: Theme.transform_ids(theme_ids))
|
ThemeField.where(type_id: ThemeField.types[:theme_upload_var], name: THEME_SPRITE_VAR_NAME, theme_id: Theme.transform_ids(theme_ids))
|
||||||
|
@ -228,6 +229,7 @@ module SvgSprite
|
||||||
|
|
||||||
custom_sprite_paths
|
custom_sprite_paths
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def self.all_icons(theme_ids = [])
|
def self.all_icons(theme_ids = [])
|
||||||
get_set_cache("icons_#{Theme.transform_ids(theme_ids).join(',')}") do
|
get_set_cache("icons_#{Theme.transform_ids(theme_ids).join(',')}") do
|
||||||
|
|
Loading…
Reference in New Issue