coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: jeeveser on February 07, 2013, 01:18:27 AM

Title: Keywords "There was an error while processing a database query"
Post by: jeeveser on February 07, 2013, 01:18:27 AM
Hi all,
I'm getting this error when I click "regenerate dictionary".

I've put the site in "debug" mode:
http://www.odbdgallery.com

This is what I get in debug mode:

Critical error
There was an error while processing a database query.

While executing query 'INSERT INTO cpg15x_dict (keyword) VALUES ('Happy Easter Daffodil Tag Set Daffodil Corner Daffodil Tag Single')' in keyword_create_dict.php on line 49

mySQL error: Duplicate entry 'Happy Easter Daffodil Tag Set Daffodil Corner Daffodil Tag S' for key 'key

File: /home3/ourdail7/public_html/odbdgallery/include/functions.inc.php - Line: 270

I recently tried installing the SocialShare plugin but had to uninstall due to this same error.

Any ideas?
Title: Re: Keywords "There was an error while processing a database query"
Post by: Jeff Bailey on February 07, 2013, 04:54:17 AM
Looks like you'll have to adjust the varchar length of the keyword column in cpg15x_dict and then fix the keywords that where cut at 60 characters.

You could also try this edit but it won't enter a new keyword in the list if the keyword is exactly the same as another up to 60 characters.
In keyword_create_dict.php
Find

            $keyword = trim($keyword);

Replace with

            $keyword = (strlen($keyword) > 60) ? substr($keyword,0,60) : $keyword;
            $keyword = trim($keyword);


Or you could shorten keywords by using the keyword separator.
Default would be
Happy Easter Daffodil Tag Set Daffodil Corner Daffodil Tag Single
becomes
Happy Easter;Daffodil Tag Set;Daffodil Corner;Daffodil Tag Single
Title: Re: Keywords "There was an error while processing a database query"
Post by: jeeveser on February 08, 2013, 11:28:18 PM
Thank you so very much Jeff!
This solved it!

You are wonderful!

May God bless you!!!
Title: Re: Keywords "There was an error while processing a database query"
Post by: Jeff Bailey on February 09, 2013, 05:38:22 AM
Thank you for confirming.
I've marked your thread as solved, please press the topic solved button at the bottom of the page in your future threads.