Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: implode error updating photo description  (Read 18125 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, 10: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: 1545
  • aka 'i-imagine'
    • Home Page
Re: implode error updating photo description
« Reply #1 on: March 22, 2012, 02: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.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: implode error updating photo description
« Reply #2 on: March 22, 2012, 09: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, 03: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, 03: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: 15764
Re: implode error updating photo description
« Reply #5 on: March 22, 2012, 03: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, 03: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: 15764
Re: implode error updating photo description
« Reply #7 on: March 22, 2012, 03: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, 04: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: 15764
Re: implode error updating photo description
« Reply #9 on: March 23, 2012, 11:29:18 am »

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

Page created in 0.024 seconds with 19 queries.