1.1 theme config sidebar bug

Discussion corner for Developers of Serendipity.
Post Reply
abdussamad
Regular
Posts: 117
Joined: Fri Apr 21, 2006 10:11 pm
Location: Karachi, Pakistan
Contact:

1.1 theme config sidebar bug

Post by abdussamad »

Hi

I noticed a bug in line 368 of include/admin/plugins.inc.php Basically it doesn't correctly allocate sidebars if you assign them to $serendipity["sidebars"] in config.inc.php. To correct it you need to replace this line:

Code: Select all

$sidebars = $serendipity['sidebars'];
with this

Code: Select all


$sidebars = explode(",",$serendipity['sidebars']);
Sincerely,
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: 1.1 theme config sidebar bug

Post by garvinhicking »

HI!

You are not allow to set $serendipity['sidebars'] with a comma seperated list. You are only allowed to set $template_config['sidebars'].

So that's not a bug, you are just using the wrong variable. $serendipity['sidebars'] is expected to be an array.

Thanks for reporting this, though! :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
abdussamad
Regular
Posts: 117
Joined: Fri Apr 21, 2006 10:11 pm
Location: Karachi, Pakistan
Contact:

Post by abdussamad »

HI!

You are not allow to set $serendipity['sidebars'] with a comma seperated list. You are only allowed to set $template_config['sidebars'].

So that's not a bug, you are just using the wrong variable. $serendipity['sidebars'] is expected to be an array.

Thanks for reporting this, though! Smile

Best regards,
Garvin
Maybe I am missing something but thats not what it says here:
If you do not want to make the sidebar names configurable by the users, you can also set $serendipity['sidebars'] = 'left,right,hide' in your template's config.inc.php file.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Ah, thank you. The $serendipity was wrong in that context, you're right. I fixed that. The header of that section though explains the use of $template_config, so at least it was partially right :-D

Thanks,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
abdussamad
Regular
Posts: 117
Joined: Fri Apr 21, 2006 10:11 pm
Location: Karachi, Pakistan
Contact:

Post by abdussamad »

garvinhicking wrote:Hi!

Ah, thank you. The $serendipity was wrong in that context, you're right. I fixed that. The header of that section though explains the use of $template_config, so at least it was partially right :-D

Thanks,
Garvin
Unfortunately setting $template_config['sidebars'] does not work either. The additional sidebars do not show up in config plugins and in manage styles I get this error:

Warning: Invalid argument supplied for foreach() in E:\Documents and Settings\Abdussamad\My Documents\My Webs\myweb2\s9y11\include\admin\templates.inc.php on line 19
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Try this in config.inc.php:

Code: Select all

$template_config = array(
  array(
        'var'           => 'sidebars',
        'title'         => 'Sidebars',
        'description'   => 'Enter the names of sidebars. Dont change if you dont know what this is :-)',
        'type'          => 'string',
        'default'       => 'left,right,top,bottom'
    ),
);
HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply