e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
322 stars 214 forks source link

glyphicons from theme.xml can't be changed without unistalling theme #4469

Closed Jimmi08 closed 1 year ago

Jimmi08 commented 3 years ago

Bug Description

It is not possible to change the path to custom glyphicons in the admin area without uninstalling the theme

How to reproduce

Theme.xml:

    <glyphicons>
        <glyph name='pixeden' pattern='\.(pe-7s-[a-z-0-9]*):before\{'  path='assets/css/fonts/pe-icon-7-stroke.css' class='pe' prefix='pe-7s-'   tag='span' />
    </glyphicons> 

Result in admin area: image

If you change the path (in my case), old path is still loaded. Clearing cache didn't help.

    <glyphicons>
        <glyph name='pixeden' pattern='\.(pe-7s-[a-z-0-9]*):before\{'  path='fonts/pe-icon-7-stroke.css' class='pe' prefix='pe-7s-'   tag='span' />
    </glyphicons>

image

Thanks

CaMer0n commented 3 years ago

@Jimmi08 Try modifying e107_admin/theme.php: (adding the setTheme() line )

if(empty($_POST) && deftrue('e_DEVELOPER') || deftrue('e_DEBUG')) // check for new theme media and import.
{
        $name = e107::getPref('sitetheme');
        $this->themeObj->setTheme($name, false); 
        e107::getMedia()->import('_common_image', e_THEME.$name, '', 'min-size=10000');
        e107::getMessage()->addInfo('Developer/Debug Mode: Scanning theme images folder for new media to import.');
}

Does it help?

Jimmi08 commented 3 years ago

I added it, but maybe I do something wrong: This is original path (wrong, just testing): /fonts/pe-icon-7-stroke.css I checked S_Meta_theme.cache.php too. It is loaded. image

Then I changed it to: path='assets/css/fonts/pe-icon-7-stroke.css'

Cleared cache. Checked theme array in S_Meta_theme.cache.php Checked theme array after SetTheme() Resaved theme prefs to be sure. There is the correct path:

"glyphs": [
            {
                "name": "pixeden",
                "pattern": "\\.(pe-7s-[a-z-0-9]*):before\\{",
                "path": "assets\/css\/fonts\/pe-icon-7-stroke.css",
                "class": "pe",
                "prefix": "pe-7s-",
                "tag": "span"
            }
        ],

But wysiwyg is loaded original path until I don't uninstall theme.

image

You can test this with landingzero theme.

EDIT: Then it hit me to check database:

  'sitetheme_glyphicons' => 
  array (
    0 => 
    array (
      'name' => 'pixeden',
      'pattern' => '\\.(pe-7s-[a-z-0-9]*):before\\{',
      'path' => 'fonts/pe-icon-7-stroke.css',
      'class' => 'pe',
      'prefix' => 'pe-7s-',
      'tag' => 'span',
    ),
  ),
Jimmi08 commented 3 years ago

This is problem: if(empty($_POST) To get this work, something has to be changed in theme prefs.

Jimmi08 commented 1 year ago

It is solved in fact. Ask for any edit is logical. Thanks