WordPress.org

Ready to get started?Download WordPress

Forums

WP Photo Album Plus
[resolved] [Plugin: WPPA+] "Could not insert photo. query=INSERT INTO `wp_wppa_photos" (21 posts)

  1. mlsrumors
    Member
    Posted 3 years ago #

    I get the following error whenever I try to upload a photo to an album or import one from the depot:

    Could not insert photo. query=INSERT INTO wp_wppa_photos (id, album, ext, name, p_order, description, mean_rating, linkurl, linktitle) VALUES ('0', '6', 'png', 'phototitle.png', '0', '', '', '', '')

  2. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    Is this a new installation?
    Is this a multisite installation?
    Please check Table IX item 5 (allow debugging), go to the import page, add &debug to the address line and press enter. You may get a better errormessage.

    Also, try Table VIII item 3: re-initialize.

  3. mlsrumors
    Member
    Posted 3 years ago #

    It is not a new installation nor is it a multisite installation.

    I'm a bit new to this. what does this mean:

    "
    Please check Table IX item 5 (allow debugging), go to the import page, add &debug to the address line and press enter. You may get a better errormessage.

    Also, try Table VIII item 3: re-initialize.

    Where are these Tables you speak of?

  4. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    In the left sidebar of the admin screen you will find the Photo Albums menu. Select the Settings tab.
    You can open the tables by clicking the Show button.
    Each setting has help under the ? at the right hand side.

  5. mlsrumors
    Member
    Posted 3 years ago #

    I followed the steps you outlined above and added the &debug to the address line of the import page and I still get the following:

    Could not insert photo. query=INSERT INTO wp_wppa_photos (id, album, ext, name, p_order, description, mean_rating, linkurl, linktitle) VALUES ('0', '6', 'jpg', 'photo.jpg', '0', '', '', '', '')

  6. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    Did you do the re-init (Table VIII item 3) ?
    You could create albums though?

  7. mlsrumors
    Member
    Posted 3 years ago #

    Yes I did the the re-init - Table VIII item 3

    And I was able to create an album before and after i did this but I am still unable to import any photos:

    Same error:
    Could not insert photo. query=INSERT INTO wp_wppa_photos (id, album, ext, name, p_order, description, mean_rating, linkurl, linktitle) VALUES ('0', '20', 'png', 'Delgado.png', '0', '', '', '', '')

  8. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    Please email me (opajaap at opajaap.nl) temporary login name and password to an administrator account.

  9. mlsrumors
    Member
    Posted 3 years ago #

    Hello Opajapp,

    Before doing that I decided to see if there was a problem with the photo album itself. It appears that there is and I sent you a .zip of the album a couple of days ago. Did you not receive it? If you did have you had a chance to look at it?

  10. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    I tested it and had no problems. Only a warning that there were one or more too smal (smaller than the thumbnail, and because we do not stretch photos...) but no errors like you have.
    See the result: Here

    Please tell me that you inspected it, i will then delete your albums from my site.

    Did you upgrade to the latest rev?

  11. mlsrumors
    Member
    Posted 3 years ago #

    Hello again, thank you for doing this. Yes, I just updated to the latest rev this morning.

    Also I have inspected the album, you may delete it now.

    But before deleting it were you able to add photos to it?

    If so, then I guess something particular to the way it's set up on our site is the problem. Check your email, I've just sent you two site log ins to see what the problem is.

  12. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    I have the same problem now after importing your photos.
    The offending photo is: (see 9223372036854775807.pmf)

    name=Ozzie Guillén
    desc=Ozzie Guillén – Chicago White Sox Manager
    pord=4
    albm=Chicago Fire
    lnku=

    it has 9223372036854775807 as an id. That seems to be the max value.

    The id is the key of the table and is auto increment.

    I do not know where this value came from, but the problem now is that there is no possibility to create new keys.

    The only solution now is:
    1. export everything
    2. drop table wp_wppa_photos
    3. run re-initialize (Photo albums -> Settings page Table VIII item 3)
    4. DELETE 9223372036854775807.pmf and 9223372036854775807.png
    5. import everything.

    Do you remember anything special around the upload or import of the offending photo?

  13. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    I forgot a step: Before importing, delete all photos and thumbnails in wp-content/uploads/wppa (photos) and wp-content/uploads/wppa/thumbs
    The old numbers will be recovered when available. If you do not delete them, you will have all photos twice. The albums is no problem, he will say: album already existed. that is not an error

  14. mlsrumors
    Member
    Posted 3 years ago #

    How do I drop table wp_wppa_photos?

  15. mlsrumors
    Member
    Posted 3 years ago #

    Ok. I figured it out and that did the trick. Can you tell me how I can reproduce the very cool looking album you made when you imported my album on your demo site?

  16. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    Table VIII item 4, make a backup of your settings.
    Table VIII item 5, load OpaJaap-green.skin, then you have my settings. that should approximate wat you saw on my site.

  17. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    btw, it you have reconstructed your photo table as described, and there were ratings to the photos, they are lost.
    For this purpose i made a new tool in version 4.0.1 that you can reconstruct the ratings with.
    (So, thanx for your problem (?) it caused the creation of an extra tool).

  18. mlsrumors
    Member
    Posted 3 years ago #

    Thank you very much, we're very glad our issue helped you develop a new tool. We did not have ratings yet because we were still building the album when we encountered the problem but we will have ratings when the albums we do go public.

    Again thank you for all your help, you have been outstanding!

    Now if we wanted to change the color of the green skin how would we go about it? Is it Table III: Backgrounds ?

    Also how do we get that shadow effect that's behind the photos on your demo site?

  19. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, its table III.

    The shadow effects are css settings that i placed in my themes css:

    .wppa-box {
    
    -moz-box-shadow: 3px 3px 4px #669933;
    -webkit-box-shadow: 3px 3px 4px #669933;
    box-shadow: 3px 3px 4px #669933;
    filter:progid:DXImageTransform.Microsoft.Shadow(color='#669933',direction='135',strength='4');
    
    }
    
    #content .wppa-box .no-shadow {
    -moz-box-shadow: none;
    -webkit-box-shadow: none;
    box-shadow: nnone;
    filter:progid:DXImageTransform.Microsoft.Shadow(color='#669933',direction='135',strength='0');
    }

    the no-shadow is for small images that you do not want to have a shadow (like the rating stars etc.)

  20. mlsrumors
    Member
    Posted 2 years ago #

    Hey, I may be of assistance to you. I just encountered the same error again. It happened only when I tried to upload a .zip file of photos. I am not sure why exactly but I can provide the .zip file to you if you need it for testing purposes.

    It was an entirely different set of photos than the one I had problems with before but it still generated that super high ID # exactly.

  21. Jacob N. Breetvelt
    Member
    Plugin Author

    Posted 2 years ago #

    Pls send me the zip (opajaap at opajaap.nl), i will investigate on it.

    In any case i will come with a solution (creating my own incremeted key and no longer rely on mysql auto increment attribute to db key.

    Then you need not to rebuild the table again.

    Fix will be released maybe today or tomorrow, would be nice if i can look into the zip first. Thanx anyway for your effort

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic