biow0lf / evedev-kb

Automatically exported from code.google.com/p/evedev-kb
1 stars 0 forks source link

Style reset to default on save in 3.1 #127

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I created a custom style for my kb at http://kb.aperture-ventures.com/ and set 
it the Global Appearance Options with the default theme.

Today I went to make a change to another option and on clicking save, the style 
is reset to default. Selecting it and saving again does not change it, only a 
manual edit to the database will change it. This behavior happens selecting any 
of the included styles as well.

I'm not exactly sure what all is supposed to be going on in changeStyle() but 
the logic doesn't seem right to me. AFAICT this bit of code always fires:

                if(options::getPrevious('theme_name') != $_POST['option_theme_name'])
                {
                        $themename = preg_replace('/[^a-zA-Z0-9-_]/', '', $_POST['option_theme_name']);
                        if(!is_dir("themes/$themename")) $themename = 'default';

                        config::set('style_name', $themename);
                        $_POST['option_style_name'] = $themename;

which has results in style_name always being set to default.

I'm using 3.1 at r792

Original issue reported on code.google.com by twe...@gmail.com on 7 Jun 2010 at 11:39

GoogleCodeExporter commented 9 years ago
That part is correct. If the theme changes then reset the style to match. If 
the theme has not changed then see if the style has.

The problems lies in r750 which was a fix for r510 which was a speed 
improvement. We're now back to before r510 again. Slower, but working.

Original comment by kovellia on 8 Jun 2010 at 1:50

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r793.

Original comment by kovellia on 8 Jun 2010 at 1:51