uploaded files not appearing
-
I’m having trouble with uploaded pictures not appearing in the browse area (picture of the browse area after uploading). I’ve verified that the files are being uploaded appropriately and have read permissions for all users. It’s like WP is just not seeing them. Does anyone have suggestions of where to look for the problem?
$ ll uploads/2007/05
total 276
-rw-r–r– 1 ba66e77 ba66e77 273797 May 21 21:22 pict0038_2.jpg
-rw-r–r– 1 ba66e77 ba66e77 3823 May 21 21:22 pict0038_2.thumbnail.jpg
-
I did an upload, tried changing the Options->Miscellaneous Store uploads in this folder and Organize my uploads into month- and year-based folders values but changing either one of those DID NOT make my upload unavailable in Manage->Uploads.
Each of those uploads is recorded as an entry in your wp_posts table. Might confirm they are there and the
guidfield on those is correct. Maybe repairing the wp_posts table is called for if you find those record in wp_posts.Thanks, Michael, but still no joy. The records are in the table (as show below) and the guid is correct. I ran REPAIR TABLE and it ran clean, but no change.
I’m using a non-standard table prefix. Is it possible that the browse script is still using the default prefix?
mysql> select id, substring(post_content,1,25),post_parent, guid, post_type from molly_posts;
+—-+——————————+————-+————————————————————————-+————+
| id | substring(post_content,1,25) | post_parent | guid | post_type |
+—-+——————————+————-+————————————————————————-+————+
| 2 | This is an example of a W | 0 | | page |
| 3 | What better way to start | 0 | http://smithweb.us/mollysBlog/?p=3 | post |
| 4 | | 3 | http://smithweb.us/mollysBlog/wp-content/uploads/2007/05/pict0038_2.jpg | attachment |
| 5 | | 3 | http://smithweb.us/mollysBlog/wp-content/uploads/2007/05/pict0038_2.jpg | attachment |
| 6 | | 3 | http://smithweb.us/mollysBlog/wp-content/uploads/2007/05/pict0038_2.jpg | attachment |
+—-+——————————+————-+————————————————————————-+————+
5 rows in set (0.00 sec)If you mean $table_prefix, I was using it with something other than wp_ and it works.
Those guids look okay to me…
Maybe set the permissions to 777 on those folders…jeesh that’s lame but all I got.
Yeah, I tried that (chmod 777) too. No change.
So far, I’ve tried
- dumping and reinstalling version 2.2
- dumping version 2.2 and installing 2.1.3
- changing image permissions to 777
- repairing the molly_posts table (note: molly_ is the prefix I’m using rather than wp_)
None of the above has had any impact. I have 2.2 working successfully on another site on another server and tried comparing the php_info() output for clues as to the difference, but I’m not seeing anything that looks relevant. The non-working one is running php 5.1.x and the working one is 5.2, but both have the same libraries available.
Any other ideas?
What’s the post_status on those records in wp_post? Should be ‘inherit’.
And the post_mime_type? Should be ‘image/jpeg’.
Status is inherit and mime_type is image/jpeg.
I did notice something which is probably significant, though I don’t know of what. In wp-admin/upload.php, the source code cuts off abruptly in the middle of a div, without closing body or html tags.
This is the source:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Mollys WebLog › Uploads — WordPress</title> <link rel="stylesheet" href="http://smithweb.us/mollysBlog/wp-admin/wp-admin.css?version=2.2" type="text/css" /> <script type="text/javascript"> //<![CDATA[ function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}} //]]> </script> <style type="text/css">* html { overflow-x: hidden; }</style> <script type='text/javascript' src='http://smithweb.us/mollysBlog/wp-includes/js/fat.js?ver=1.0-RC1_3660'></script> <link rel='stylesheet' href='http://smithweb.us/mollysBlog/wp-admin/upload.css?version=2.2a' type='text/css' /> </head> <body> <div id="wphead"> <h1>Mollys WebLog <span>(<a href="http://smithweb.us/mollysBlog/">View site »</a>)</span></h1> </div> <div id="user_info">Howdy, <strong>Barrett</strong>. [<a href="http://smithweb.us/mollysBlog/wp-login.php?action=logout" title="Log out of this account">Sign Out</a>, <a href="profile.php">My Profile</a>] </div> <ul id="adminmenu"> <li><a href='index.php'>Dashboard</a></li> <li><a href='post-new.php'>Write</a></li> <li><a href='edit.php' class="current">Manage</a></li> <li><a href='edit-comments.php'>Comments</a></li> <li><a href='link-manager.php'>Blogroll</a></li> <li><a href='themes.php'>Presentation</a></li> <li><a href='plugins.php'>Plugins</a></li> <li><a href='users.php'>Users</a></li> <li><a href='options-general.php'>Options</a></li></ul> <ul id="submenu"> <li><a href='edit.php'>Posts</a></li> <li><a href='edit-pages.php'>Pages</a></li> <li><a href='upload.php' class="current">Uploads</a></li> <li><a href='categories.php'>Categories</a></li> <li><a href='templates.php'>Files</a></li> <li><a href='import.php'>Import</a></li> <li><a href='export.php'>Export</a></li> </ul> <div class='wrap'> <h2>Uploads</h2> <ul id='upload-menu'> <li class='upload-tab alignleft current'><a href='/mollysBlog/wp-admin/upload.php?tab=browse-all&ID&action&paged' class='upload-tab-link' title='Browse All'>Browse All</a></li> </ul> <div id='upload-content' class='browse-all'>Well mine ends in the expected
</body> </html>May download the 2.2 distribution from the download link above, unzip it, delete the 2.2 files on your server, and reupload the files.
I’ve scrubbed the original installation and reinstalled everything, and still no change.
I’ve set php’s error_reporting level to E_ALL and have errors logged to a file, but I”m not getting any errors in the log. Is WP resetting the error logging/reporting levels somewhere?
It seems like the problem has to be somewhere in line 126 of wp-admin/upload.php
126 call_user_func( $wp_upload_tabs[$tab][2] );$wp_upload_tabs[$tab][2] evaluates to “wp_upload_tab_browse”
I’m having a hard time finding where this function is defined. Can someone point me in the right direction? Is there an index somewhere listing where each function wp uses is defined?
The fun continues……
I found wp_upload_tab_browse and edited it up with error_log calls so I could see what it was doing. From what I get in the error log, it looks like it’s silently dying in
$attachments = query_posts("what_to_show=posts&posts_per_page=10&paged=$paged");The full output of the error_log calls is:
36 [23-May-2007 10:54:35] executing wp_upload_tab_browse: action =
37 [23-May-2007 10:54:35] executing defualt of wp_upload_tab_browse
38 [23-May-2007 10:54:35] tab= browse-all post_id=0 style=
39 [23-May-2007 10:54:35] if you see this, I got past the add_action line
40 [23-May-2007 10:54:35] getting ready to set attachments variablethe edited file is
285 function wp_upload_tab_browse() { 286 global $wpdb, $action, $paged; 287 $old_vars = compact( 'paged' ); 288 289 error_log("executing wp_upload_tab_browse: action = ". $action); 290 291 switch ( $action ) : 292 case 'edit' : 293 case 'view' : 294 global $ID; 295 $attachments = query_posts("attachment_id=$ID"); 296 if ( have_posts() ) : while ( have_posts() ) : the_post(); 297 'edit' == $action ? wp_upload_form() : wp_upload_view(); 298 endwhile; endif; 299 break; 300 default : 301 error_log("executing defualt of wp_upload_tab_browse"); 302 global $tab, $post_id, $style; 303 304 error_log("tab= $tab post_id=$post_id style=$style"); 305 306 add_action( 'pre_get_posts', 'wp_upload_grab_attachments' ); 307 308 error_log("if you see this, I got past the add_action line"); 309 310 if ( 'browse' == $tab && $post_id ) 311 add_filter( 'posts_where', 'wp_upload_posts_where' ); 312 313 error_log("getting ready to set attachments variable"); 314 315 $attachments = query_posts("what_to_show=posts&posts_per_page=10&paged=$paged"); 316 317 error_log("attachements variable set to ". $attachments); 318 error_log("getting ready to set count_query variable"); 319 320 $count_query = "SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment'"; 321 322 error_log("count_query---- ".$count_query); 323 324 if ( $post_id ) 325 $count_query .= " AND post_parent = '$post_id'"; 326 $total = $wpdb->get_var($count_query); 327 328 error_log($count_query.' ---- '.$total); 329 330 echo "<ul id='upload-files'>\n"; 331 if ( have_posts() ) : while ( have_posts() ) : the_post(); 332 $href = wp_specialchars( add_query_arg( array( 333 'action' => 'inline' == $style ? 'view' : 'edit', 334 'ID' => get_the_ID()) 335 ), 1 ); 336 337 echo "\t<li id='file-"; 338 the_ID(); 339 echo "' class='alignleft'>\n"; 340 echo wp_upload_display( array(128,128), $href ); 341 echo "\t</li>\n"; 342 endwhile; 343 else : 344 echo "\t<li>" . __('There are no attachments to show.') . "</li>\n"; 345 endif; 346 echo "</ul>\n\n"; 347 348 echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' ) . "' /></form>\n"; 349 break; 350 endswitch; 351 352 extract($old_vars); 353 }Am I really the only one having this problem? I’ve scrubbed and reinstalled the code so many times, I can’t help but think it’s a server configuration issue, but also can’t believe my host is configured so oddly.
[this response was stuck in Akismet spam–sorry]
Using WinGrep found that function in wp-admin/upload-functions.php.
The topic ‘uploaded files not appearing’ is closed to new replies.