Problem: Clicking the “Add Photo” link opens up a New Page

Clicking the “Add Photo” link opens up a New Page, usually a 404 error.  What gives?

This symptom can have a couple of different sources.

  1. Most frequently, this is a template problem.  There are two template tags (PHP code that is specific to WordPress and used in Themes to make stuff happen) that should be called in all WordPress Themes…well, at least all the ones that intend to use plugins or do anything cool:
    1. wp_head() – should be called in the header.php file,
    2. wp_footer() – should be called in footer.php

    Some of the commercial frameworks may have abstracted these calls away into their own hooks. But if you’re using a theme by one of these guys, this is probably not your problem.

  2. If #1 is not the problem, then there might be a plugin that is causing a problem in either
    1. The PHP script on the server – you’ll probably see a PHP error somewhere
    2. The Javascript on the client – if you run FireFox, get FireBug and it can help you spot JavaScript errors

    Try deactivating your plugins to see if you can isolate the offending plugin.  If there are lots of activated plugins, I usually try deactivating big chunks of them instead of 1-by-1.  Figure out which big chunk the problem is in and narrow down from there.

    After you find the offending plugin, the fun begins…you can try to fix it yourself, or try to get the plugin developer to fix it for you.

    Free tip: If you’re running a bunch of plugins ( 10 or more ), you might want to consider if you really need all of them…maybe not. Plugins usually require extra processing time, so in general, the fewer the faster (notable exceptions exist). All the same, don’t be afraid of using plugins, just be selective.  They are the one of the greatest features of WordPress.

  3. Another problem might be clicking the Add Photo button before the page is completely loaded.  The Thickbox initialization occurs late in the page load, so you have to wait for it…I’m going to hide the Add Photo button until it’s ready in a future version of PhotoSmash.
  4. Another issue on the user’s end might be that their browser might be blocking Javascript (or have it turned off).  The upload is AJAX and requires Javascript be on, even if you’re always displaying the upload form (forgoing the Thickbox).

If you come up with some other causes and solutions, please post below and I’ll add to the list!

Filed under: Troubleshooting
  • 19 Comments

  • byron says:

    Comments closed…please use forums:

    http://smashly.net/community/

  • erwin says:

    Hi there,

    somehow I have a problem, that clicking the add photo button, will give me the add photo screen but with 2x all the inputfields and buttons. If I close the window (with the x instead of by clicking ‘done’) the next time i click add photo, the entire window is empty.

    I disabled the wp e-commerce shopping cart plugin and then the add photo box works like normal again. I will post this too with the shopping cart developer (WordPress Shopping Cart by Instinct Entertainment) for support, but thought i might mention it here to see if anything can be done from within photosmash (which totally rocks by the way ;) ).

    • byron says:

      Hi erwin,

      Thanks for the compliment!

      I can’t imagine what is going on with Shopping Cart. PhotoSmash uses the normal Thickbox function, so I’m thinking they have probably hi-jacked that javascript function and are doing something on the event.

      One thing you might try is to turn off the Thickbox and just let the form show up on the page…you can either have it hidden and show it on clicking the Add Photo link or you can have it showing all the time.

      Cheers,
      Byron

    • byron says:

      Oh…Please use the forums instead of comments…I’m actually trying to shut down comments because I can’t keep track of where all the comments come into otherwise ;-) The forums keep everything in one place, at least.

      Cheers,
      Byron

  • Russell says:

    I keep getting this error when clicking the add photo link using the Google Chrome browser.

    The requested URL /TB_inline was not found on this server.

    I’m on version 4.01 of photosmash and version 2.7 of wordpress. Add photo is set to allow administrator upload only at the moment.

    The link to the page I’m trying to use photosmash on is http://northwesteverett.org/?page_id=1495

    Any help would be appreciated.

    • Russell says:

      I’m noticing a javascript error with the function bwbpsShowPhotoUpload.

      Seems to be looking for the form_pfx but when I’m clicking the link it is not passing in a value which is causing the error.

      Novice programmer so again any help appreciated.

  • luupuxall says:

    how can I put 300 photos with a single update?
    Thank you.

  • SKunder says:

    Kalil’s Javascript is enabled and she’s running 2.0. Any more suggestions for her?

  • SKunder says:

    Thanks! I just wanted to make sure I was thinking along the correct lines. :)

  • SKunder says:

    I’m having some users (http://www.cornsnakemorphgallery.com/forum/?wpforumaction=viewtopic&t=23.00) having problems getting the upload box to work. I’m not sure what it could possibly be other then what I’ve already suggested to them.

    • byron says:

      SKunder,

      I checked out the thread. There is something going on with their JavaScript, similar to what is described in this 404 Post. I need to add a couple of the items you mentioned in your forum: 1) wait for the page to completely load before clicking Add Photo; 2) make sure JavaScript is not blocked on the browser.

      The fact that the one user was able to do it with Explorer, but not FF makes me think something is awry in the browser settings.

      I don’t think it’s a PhotoSmash problem, but I definitely want to squash it if it is.

      It does give me the idea to put a message on there that JavaScript must be enabled, and have JS replace it with the Add Photo button when the page is ready for uploading.

      That way, the user would be made aware that JS is a problem and they won’t be fooled with the Add Photo button.

      I’ll put it on the list.

      Please let me know if you find out what the problem is and I’ll document here.

      Cheers,
      Byron