Tag Cloud not using config values

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

Tag Cloud not using config values

Postby Khevor » Fri Aug 08, 2008 11:23 pm

I don't know where the bug tracker is to search if you've found this bug already or not (or if it's even a bug, for that matter), so forgive me if this is a double find.

Pivot-X ver. used: 1.9

When you use the [[tagcloud]] in the sidebar template (haven't tried it in full page templates), it doesn't use the tag_max_font or tag_min_font values from the config table. Instead, it uses hard-coded values:

From modules_smarty.php:
Code: Select all
function smarty_tagcloud($params, &$smarty) {
    global $PIVOTX;

    $params = clean_params($params);

    $minsize = get_default($params['minsize'], 9);
    $maxsize = get_default($params['maxsize'], 17);
    $amount = get_default($params['amount'], 30);


I assume the $params are called from the [[tagcloud]] tag itself, is that right? For example [[ tagcloud minsize="10" maxsize="20" amount="30" ]] <= like that?
I then assume that if those values aren't specified, it defaults to the hard-coded 9, 17, and 30 respectively, is that also true?

If my assumptions are true, then why not have:
Code: Select all
   $minsize = get_default($params['minsize'], $PIVOTX['config']->get('tag_min_font'));
   $maxsize = get_default($params['maxsize'], $PIVOTX['config']->get('tag_max_font'));
   $amount = get_default($params['amount'], 30);


That way it actually uses the values that already exist in Pivot's Tag config instead of hard-coded values.

(On a side note: a config value for amount doesn't exist - and probably should set with a default value of 30.)

I only noticed this because I wanted to change the sizes of the tags in the tag cloud on my site but no matter what I put into the config, nothing changed. It wasn't until after I started snooping in the code that I found this and guessed how the $params were used. My apologies if I'm way off base here.
Khevor
 
Posts: 26
Joined: Sun Aug 03, 2008 2:37 am
Location: Ontario, Canada

Re: Tag Cloud not using config values

Postby Bob » Sat Aug 23, 2008 12:45 pm

Thanks for reporting! We'll fix this! It's on the bug tracker now: http://tracker.pivotx.net/view.php?id=395
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: Tag Cloud not using config values

Postby Bob » Sat Aug 23, 2008 1:26 pm

Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm


Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 2 guests

cron