Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Keyword field size limit  (Read 3444 times)

0 Members and 1 Guest are viewing this topic.

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Keyword field size limit
« on: September 27, 2013, 01:31:16 am »

I see that the keyword field in the  image database is 255 characters.   Can that be expanded?   I want to create a large gallery searchable by keywords and many of my images are having their keyword lists truncated because of the limit.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Keyword field size limit
« Reply #1 on: September 27, 2013, 09:38:28 pm »

Sure. I currently have no option to look at the database, but you probably have to change the data type to something like TEXT, as we usually use VARCHAR, which supports only 255 characters. Additionally, you probably have to extend Coppermine's forms. Again, without code access I'm not quite sure. If you don't know your way around, let me know and I'll give more detailed instructions as soon as possible.
Logged

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Re: Keyword field size limit
« Reply #2 on: September 28, 2013, 12:58:01 am »

Thanks, I'll try just changing the keyword field to text with a length of about 400.

I have noticed however that, when I have keywords that exceed the 255 char limit, sometimes keywords are truncated at the beginning, and at the end of the list.   What would cause that?
Logged

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Re: Keyword field size limit
« Reply #3 on: September 28, 2013, 01:07:00 am »

Well I set the field type to TEXT, and the length values to 400 (although that field in phpmyadmin now reads blank), but I still get the same truncation of my keywords.

Perhaps there is code that limits ingested keywords to a total of 255 chars?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Keyword field size limit
« Reply #4 on: October 01, 2013, 04:21:21 pm »

Have you adjusted any PHP code yet?
Logged

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Re: Keyword field size limit
« Reply #5 on: October 01, 2013, 04:47:39 pm »

I have not changed any code.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Keyword field size limit
« Reply #6 on: October 04, 2013, 10:06:40 am »

Adjust the following values to your needs:
Quote from: edit_one_pic.php
<input type="text" style="width: 100%" name="keywords" maxlength="255" value="{$CURRENT_PIC['keywords']}" id="keywords" class="textinput" />
Quote from: editpics.php
array($icon_array['keyword'] . $keywordLabel, 'keywords', 0, 255),

I haven't found any limitations at the keyword manager. If I missed a form where you can change keywords, let me know.
Logged

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Re: Keyword field size limit
« Reply #7 on: October 04, 2013, 07:30:52 pm »

I also found this in upload.php:

Quote
            $form_array[] = array($keywordLabel, 'keywords', 0, 255, 1);

Would this cause the keywords in uploaded images to be truncated to 255 even if the database field was 400?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Keyword field size limit
« Reply #8 on: October 04, 2013, 08:19:30 pm »

Correct.
Logged

jaus

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 84
Re: Keyword field size limit
« Reply #9 on: October 06, 2013, 03:24:41 pm »

Expanding the KEYWORDS field in the PICUTURES table, and settting the keywords dimensions in the three lines quoted above to match the field width seems to have fixed the problem.

Thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.