Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: implode error updating photo description  (Read 8675 times)

0 Members and 1 Guest are viewing this topic.

gtgillis

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 40
implode error updating photo description
« on: March 21, 2012, 11:48:24 PM »

While viewing any photo I click on "Edit File Information" below the photo to show the edit form. When I try to add text to a photo description I get the following error.

Code: [Select]
An error has occurred:

(This text is only displayed to users in the group 'Root')

2 - implode(): Invalid arguments passed @ /var/www/coppermine/edit_one_pic.php line 116

I am running 1.5.18.
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1493
  • aka 'i-imagine'
    • Home Page
Re: implode error updating photo description
« Reply #1 on: March 22, 2012, 03:08:27 AM »

That line is looking at keywords.
Code: [Select]
    $keywords = implode($CONFIG['keyword_separator'], $keywords_new);
I could not reproduce the effect.
Remove / change the keywords.
Look at interference from plugins and your theme.
Otherwise post a link to your Coppermine so someone can take a look.
Logged
"My life has become an array of LEDs"

i-imagine.net - Artists Gallery <> My  Photo Gallery

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15268
Re: implode error updating photo description
« Reply #2 on: March 22, 2012, 10:54:10 AM »

What's your keyword separator setting?
What have you entered in the keywords field? Have you entered anything at all?
Logged

gtgillis

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 40
Re: Re: implode error updating photo description
« Reply #3 on: March 22, 2012, 04:09:18 PM »

That line is looking at keywords.
Code: [Select]
    $keywords = implode($CONFIG['keyword_separator'], $keywords_new);
I could not reproduce the effect.
Remove / change the keywords.
Look at interference from plugins and your theme.
Otherwise post a link to your Coppermine so someone can take a look.

I was only entering text in the description. I did not use keywords when I got the error. Oddly, when I enter a keyword and a description it saves just fine. I'll keep looking.
Logged

gtgillis

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 40
Re: Re: implode error updating photo description
« Reply #4 on: March 22, 2012, 04:11:14 PM »

What's your keyword separator setting?
What have you entered in the keywords field? Have you entered anything at all?

I have Enable clickable keywords in search checked and Keyword separator set to space.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15268
Re: implode error updating photo description
« Reply #5 on: March 22, 2012, 04:23:26 PM »

Works as expected for me with that settings. I assume it's a server-sided issue, but we can try to fix it anyway.

Please open edit_one_pic.php, find
Code: [Select]
$keywords = explode($CONFIG['keyword_separator'], trim(html_entity_decode($keywords)));and below, add
Code: [Select]
$keywords_new = array();
Please report if it works as expected for you.
Logged

gtgillis

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 40
Re: Re: implode error updating photo description
« Reply #6 on: March 22, 2012, 04:33:29 PM »

Works as expected for me with that settings. I assume it's a server-sided issue, but we can try to fix it anyway.

Please open edit_one_pic.php, find
Code: [Select]
$keywords = explode($CONFIG['keyword_separator'], trim(html_entity_decode($keywords)));and below, add
Code: [Select]
$keywords_new = array();
Please report if it works as expected for you.

That fixed it! Thanks.
Now I guess the question is why did this work?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15268
Re: implode error updating photo description
« Reply #7 on: March 22, 2012, 04:48:21 PM »

The function implode expects an array as second parameter. If you haven't entered a keyword, $keywords_new is undefined. With the new line we define $keywords_new as array regardless if keywords have been submitted or not.

However, this is the first time for me that PHP behaves like that (the error message is not from Coppermine by the way).
Logged

gtgillis

  • Contributor
  • Coppermine novice
  • ***
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 40
Re: Re: implode error updating photo description
« Reply #8 on: March 22, 2012, 05:06:18 PM »

The function implode expects an array as second parameter. If you haven't entered a keyword, $keywords_new is undefined. With the new line we define $keywords_new as array regardless if keywords have been submitted or not.

However, this is the first time for me that PHP behaves like that (the error message is not from Coppermine by the way).

I am using PHP version 5.3.6-13ubuntu3.6.

I am marking this as solved. Thanks again.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15268
Re: implode error updating photo description
« Reply #9 on: March 23, 2012, 12:29:18 PM »

Committed fix in SVN revision 8348.
Logged
Pages: [1]   Go Up
 

Page created in 0.089 seconds with 20 queries.