Tag Cloud Bug (Solution inside)

Please report bugs here!

Moderator: Thorsten

Post Reply
dgrieve
Posts: 1
Joined: Wed May 12, 2010 2:12 pm

Tag Cloud Bug (Solution inside)

Post by dgrieve »

Hi there,

We had an issue with the Tag Cloud (file /inc/Tags.php) where the tag cloud array was being indexed from 0, resulting in the incorrect tag being displayed when you clicked on one. The problem line was line #117, ours looked like this:

Code: Select all

$tags = array_slice($tags, 0, $numberOfItems);
and should be:

Code: Select all

$tags = array_slice($tags, 0, $numberOfItems, true);
This is in order to preserve the keys when performing the slice, as array_slice re-indexes the array.
Last edited by dgrieve on Wed May 12, 2010 2:33 pm, edited 1 time in total.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Tag Cloud Bug (Solution inside)

Post by Thorsten »

Hi,

you're right! I already fixed it and pushed it to my github repo.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply