Support » Plugin: EntryWizard » WordPress database error after fresh install

  • Resolved David Lingren

    (@dglingren)


    I just downloaded and activated your version 1.0.0.

    I added the shortcode [ewz_show_webform identifier="pair"] to a page and tried to upload a new image. When I clicked the Submit button I got a dialog box that said (in part) “WordPress database error [Field last_change doesn’t have a default value]” and “Sorry, there was a problem creating the item …”

    I made a change to the save() function in ewz-item.php that avoids the error:

    } else {
    //                $data['upload_date'] = current_time( 'mysql' );
    //                array_push( $datatypes, '%s' );
                    $data['last_change'] = $data['upload_date'] = current_time( 'mysql' );
                    array_push( $datatypes, '%s' );
                    array_push( $datatypes, '%s' );
    
                    $wpdb->insert( EWZ_ITEM_TABLE, $data, $datatypes );
                    $inserted = $wpdb->insert_id;
                    if ( !$inserted ) {
                        foreach( $this->item_files as $item_file ){
                            $errors .= $this->delete_file( $item_file );
                        }
                        throw new EWZ_Exception( 'Sorry, there was a problem creating the item '. basename( $item_file['fname'] ) .
                                                 ", please refresh the page to see your current status.\n", $errors );
                    }
                }

    As you can see, I commented out two original lines and added some code to supply a value for ‘last_change’.

    I also had a problem with the “Example Competition Form”. I selected “Digital”, supplied a title and clicked “Submit”. I got a dialog box that said “Sorry, there was an error in row 1: A Digital type must have an Image File.” There is no visible field on the form where I can supply an image file.

    http://wordpress.org/plugins/entrywizard/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Josie Stauffer

    (@joanne123)

    Thanks, and apologies – there seem to be some issues with the latest versions of WordPress and MySql. I’ll get changes out ASAP.

    Plugin Author Josie Stauffer

    (@joanne123)

    I’ve uploaded a new version. Please let me know if that fixes the issue for you.

    Thread Starter David Lingren

    (@dglingren)

    Josie,

    Thanks for the quick action and this update. I am traveling in Guatemala until February 10, but I will give this a try when I return home.

    Thread Starter David Lingren

    (@dglingren)

    Josie,

    I finally had a chance to test the new version; thanks for your patience.

    First, I simply updated from v1.0.0 to v1.0.1. This didn’t go so well. The “Image Pair Layout” Fields list was empty, and my attempt to copy the layout to a new layout failed with PHP notices and an error message about no fields begin defined. The “front end” display generated by the ewz_show_webform shortcode also had problems, e.g., only one image was displayed.

    Second, I deactivated and deleted the plugin, then installed a fresh copy of v1.0.1. That worked fine. I was able to use both the Image Pair Form and Example Competition Form without any errors.

    In summary, a fresh install worked fine, but a version upgrade had problems. I am satisfied with the resolution of this issue, because deleting and re-installing worked.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress database error after fresh install’ is closed to new replies.