Sitemap Bug duplicating alphabet letters, PMF 2.6.5

Please report bugs here!

Moderator: Thorsten

Post Reply
dajoker
Posts: 59
Joined: Sat Jan 30, 2010 1:01 am

Sitemap Bug duplicating alphabet letters, PMF 2.6.5

Post by dajoker »

I assume this is a bug. In my environment each of the letters at the top of the Sitemap (to let you get to things starting with the various letters) are duplicated. For example, when I click on SiteMap I get the following list across the page (notice that digits are not duplicated):

0 1 2 3 4 5 6 7 8 A A B B C C D D E E F F G G H H I I J J K K L L M M N N O O P P Q Q R R S S T T U U V V W W X X Y Y Z Z

Each of those is a link and the link for two letters which are the same are identical such as shown below:

http://1.2.3.4/phpmyfaq/index.php?actio ... =A&lang=en
http://1.2.3.4/phpmyfaq/index.php?actio ... =A&lang=en

I am currently only using English-based FAQs. Each of the sections with a letter above DOES have at least one (if not many more) FAQ entries showing within. Some are missed (number 9 for example) indicating the same.

On a 2.6.4 system I have from a while back (with only 10K entries) I do not see this but I do not know if that is because of the version difference or the difference in system size.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Sitemap Bug duplicating alphabet letters, PMF 2.6.5

Post by Thorsten »

Hi,

I will try to reproduce this and fix this issue.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Sitemap Bug duplicating alphabet letters, PMF 2.6.5

Post by Thorsten »

Hi,

could you please tell me the SQL result of this query?

Code: Select all

SELECT
                        DISTINCT substring(fd.thema, 1, 1) AS letters
                    FROM
                        faqdata fd
                    LEFT JOIN
                        faqdata_group AS fdg
                    ON
                        fd.id = fdg.record_id
                    LEFT JOIN
                        faqdata_user AS fdu
                    ON
                        fd.id = fdu.record_id
                    WHERE
                        fd.lang = 'de'
                    AND
                        fd.active = 'yes'
                    AND
                        ( fdg.group_id IN (-1)
            OR
                (fdu.user_id = -1 AND fdg.group_id IN (-1)))
                    ORDER BY
                        letters
Thank you very much!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
dajoker
Posts: 59
Joined: Sat Jan 30, 2010 1:01 am

Re: Sitemap Bug duplicating alphabet letters, PMF 2.6.5

Post by dajoker »

Lotsa nothing. :-)

Of course, if I change the language section to English ('de' to 'en') I get a lot. I think I see the problem as well. I get results that are distinct, as requested, but 'e' and 'E' are distinct where the page then shows them all in upper-case on the webpage, and also queries for them (when clicking on those links in the webpage) in a case-insensitive way. Adding UPPER around the substring section seems to resolve this:

SELECT DISTINCT UPPER(substring(fd.thema,1,1)) AS letters
.......



Total SQL:
SELECT
DISTINCT UPPER(substring(fd.thema, 1, 1)) AS letters
FROM
faqdata fd
LEFT JOIN
faqdata_group AS fdg
ON
fd.id = fdg.record_id
LEFT JOIN
faqdata_user AS fdu
ON
fd.id = fdu.record_id
WHERE
fd.lang = 'en'
AND
fd.active = 'yes'
AND
( fdg.group_id IN (-1)
OR
(fdu.user_id = -1 AND fdg.group_id IN (-1)))
ORDER BY
letters;

Substituting in 'de' for 'en' of course.

As a note I guess the reason this did not happen in 2.6.4, if not because of code, was because that environment had 1/6 as many FAQs and only newer one (vs. older ones) which may have had all upper-case beginnings to the title/question ('thema' column).

Thanks for the pointer.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Sitemap Bug duplicating alphabet letters, PMF 2.6.5

Post by Thorsten »

Hi,

yes, the UPPER() function fixes this issue and it's also available on all supported databases. :-)

I add this fix for 2.6.6! Thank you very much!

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