Edit comment problem

Hi,

I have a problem with zenphoto on my website. When i try to edit a comment and click on Save, i have this error :

Zenphoto Error
La requête MySQL ( UPDATE `zp_comments` SET `name` = 'Dylan Donckers', `email` = 'mister-du-7012@hotmail.com', `website` = 'http://xx-d-2y-l-2a-n-xx.skyblog.com', `comment` = 'Ah non pas la photo la xD pas belle mdr\'rr', `custom_data`='a:5:{s:6:\"street\";s:0:\"\";s:4:\"city\";s:0:\"\";s:5:\"state\";s:0:\"\";s:7:\"country\";s:0:\"\";s:6:\"postal\";s:0:\"\";}' WHERE id = 162 ) a échoué. Erreur : Unknown column 'custom_data' in 'field list'

Can you help me please? How can i fix this without upgrade zenphoto to 1.2.8 ?

Version installed : Zenphoto version 1.2.6 [4335]

Thank you very much!

Comments

  • acrylian Administrator, Developer
    We don't support older versions anymore. So your best chance is indeed to try 1.2.8. I also don't remember to have seen this error before (actually custom data has nothing to do with comments).
  • Ok thanks for your reply. I don't know what can I change to "exclude" this "custom_data". I replaced the original admin-comments.php file but it's the same problem. Here is the code if that help :

    `
    case 'savecomment':
    if (!isset($_POST['id'])) {
    header("Location: " . FULLWEBPATH . "/" . ZENFOLDER . "/admin-comments.php");
    exit();
    }
    $id = sanitize_numeric($_POST['id']);
    $name = mysql_real_escape_string(sanitize($_POST['name'], 3));
    $email = mysql_real_escape_string(sanitize($_POST['email'], 3));
    $website = mysql_real_escape_string(sanitize($_POST['website'], 3));
    $date = mysql_real_escape_string(sanitize($_POST['date'], 3));
    $comment = mysql_real_escape_string(sanitize($_POST['comment'], 1));
    $custom = zp_apply_filter('save_comment_custom_data', '');
    if (!empty($custom)) {
    $custom = ", custom_data='".mysql_real_escape_string($custom)."'";
    }

    $sql = "UPDATE ".prefix('comments')." SET name = '$name', email = '$email', website = '$website', comment = '$comment'".$custom." WHERE id = $id";
    query($sql);

    header("Location: " . FULLWEBPATH . "/" . ZENFOLDER . "/admin-comments.php?sedit");
    exit();

    }
    `
  • Just want to say that I had a previous error before :

    Fatal error: Call to undefined function snitize_numeric() in /home/www/98bec7b8fc1b151455689b24607faeaa/web/Diaporama/zp-core/admin-comments.php on line 84

    So i fixed this error with this topic : http://www.zenphoto.org/support/topic.php?id=6024

    " It is a typographical error. It is fixed in the nightly builds or you can simply change that line to say sanitize_numeric() "

    So now i don't know what to do... maybe it helps for you...
  • acrylian Administrator, Developer
    The fix is to upgrade.. Also it is not recommended to hack core files.
Sign In or Register to comment.