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.
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.
That line is looking at keywords.
$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.
What's your keyword separator setting?
What have you entered in the keywords field? Have you entered anything at all?
Quote from: Joe Carver on March 22, 2012, 02:08:27 AM
That line is looking at keywords.
$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.
Quote from: Αndré 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?
I have Enable clickable keywords in search checked and Keyword separator set to space.
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
$keywords = explode($CONFIG['keyword_separator'], trim(html_entity_decode($keywords)));
and below, add
$keywords_new = array();
Please report if it works as expected for you.
Quote from: Αndré 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
$keywords = explode($CONFIG['keyword_separator'], trim(html_entity_decode($keywords)));
and below, add
$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?
The function implode (http://www.php.net/manual/en/function.implode.php) 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).
Quote from: Αndré on March 22, 2012, 03:48:21 PM
The function implode (http://www.php.net/manual/en/function.implode.php) 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.
Committed fix in SVN revision 8348.