Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Barrett

    (@barrett)

    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 variable

    the 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]

    Thread Starter Barrett

    (@barrett)

    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?

    Thread Starter Barrett

    (@barrett)

    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?

    Thread Starter Barrett

    (@barrett)

    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" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml"  dir="ltr">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Mollys WebLog &rsaquo; Uploads — WordPress</title>
    <link rel="stylesheet" href="https://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='https://smithweb.us/mollysBlog/wp-includes/js/fat.js?ver=1.0-RC1_3660'></script>
    <link rel='stylesheet' href='https://smithweb.us/mollysBlog/wp-admin/upload.css?version=2.2a' type='text/css' />
    </head>
    <body>
    
    <div id="wphead">
    <h1>Mollys WebLog <span>(<a href="https://smithweb.us/mollysBlog/">View site &raquo;</a>)</span></h1>
    </div>
    <div id="user_info">Howdy, <strong>Barrett</strong>. [<a href="https://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'>

    Thread Starter Barrett

    (@barrett)

    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?

Viewing 5 replies - 1 through 5 (of 5 total)