• I can’t seem to find Owen Winkler’s email, nor a current download for Exhibit. But for those out there still using this plugin, this “fix” of mine might be of interrest.

    I found a bug that occurs if you’ve got Exhibit activated while simultaneously using wordpress’ own Upload-thingy.

    It’s easy to replicate; (with exhibit activated) create a new post and upload a picture (using the internal upload). Send it to the post and hit publish. Now edit that same post – it doesn’t matter if you alter anything or not – and hit save. Here’s a picture for you. You’ll get;

    Warning: Invalid argument supplied for foreach() in /.../wp-content/plugins/exhibitimg/exhibit10i.php on line 310
    Warning: Cannot modify header information - headers already sent by (output started at /.../wp-content/plugins/exhibitimg/exhibit10i.php:312) in /.../wp-includes/pluggable-functions.php on line 269

    Returning to your blog you’ll notice everything went fine anyway – the pictures are there and everything saved properly.

    I took a look at the file in question (exhibit10i.php) and changed this part to stop it from misbehaving;

    // process_exhibit_form: Accepts input from the form and makes changes
    function exhibit_process_form($id)
    {
    global $wpdb, $exc;


    if($_POST['ex_caption'] > 0)
    {

    //Change captions
    foreach($_POST['ex_caption'] as $index => $item)
    {
    $wpdb->query("UPDATE {$exc->tableexhibit} SET caption = '$item' WHERE ID = $index LIMIT 1;");
    }

    }

    }
    To be honest I have no idea what was happening or why. I think this extra code of mine (the if-clause) makes sure there actually is something to change, before trying to update the database. But I’m not sure of that either. However, it did stop the warnings and everything is working like a charm now.

    If you’ve got any ideas or thoughts about this, please let me know. I don’t like fiddling around with code unknown.

    Here’s the “fixed” file, so you don’t have to edit yours manually.

  • The topic ‘“patch” to Exhibit (Owen Winkler’s)’ is closed to new replies.