404 User profile page

When I click a username to view their profile page, I'm getting a page not found.

The questions can be found at http://thestudentlawyer.com/questions/

And you'll see the error if you click any user.

Thanks

  • aecnu

    Greetings lewischeney,

    Thank you for bringing this items to our attention in which after checking the page for errors and running through check the profile as you indicated, I found the following console error when moving to the profile page:

    Resource interpreted as Script but transferred with MIME type text/html: "http://rockwoodmaple.com/?dm=8ced2264e2c0546eb45f0de6d298d067&action=load&b…ck=http%3A%2F%2Fthestudentlawyer.com%2Fquestions%2Fuser%2Fmike_donnelly%2F". thestudentlawyer.com:84

    But I admit I am not familiar with this error nor what could possibly cause it but I believe this is what is causing our issue there on this particular installation.

    Therefore I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • Hakan

    If you have user-question.php file in /themes/extranews/ folder, somebody must have been copied it there. Q&A does not do that. Maybe your theme developer?

    If there is such a file in your theme folder, Q&A will use it.

    What do you see inside that file? Can you paste its contents here? If it is empty, just delete it.

    Admin account will not be enough in this case. FTP account will be required too.

    Cheers,
    Hakan

  • lewischeney
    <?php get_header(); ?>
    
    <div class="container clearfix titlecontainer">
      	<?php do_action( 'qa_before_content', 'edit-question' ); ?>
    
    	<?php the_qa_menu(); ?>
        <!-- Page Title
        ================================================== -->
        <div class="pagetitlewrap">
            <h1 class="pagetitle">
                <?php wp_title("",true);
                if(!wp_title("",false)) { echo bloginfo( 'title');} ?>
            </h1>
            <div class="mobileclear"></div>
            <span class="description">
              <?php if ($tagline_text = get_post_meta($post->ID, 'ag_page_desc', $single = true)) { echo '<p>' . $tagline_text . '</p>'; } ?>
            </span>
        </div>
        <div class="clear"></div>
    
        <!-- Page Content
          ================================================== -->
        <div class="qa-maincontent page">
    
    	<div id="qa-user-box">
    		<?php echo get_avatar( get_queried_object_id(), 128 ); ?>
    		<?php the_qa_user_rep( get_queried_object_id() ); ?>
    	</div>
    
    	<table id="qa-user-details">
    		<tr>
    			<th><?php _e( 'Name', QA_TEXTDOMAIN ); ?></th>
    			<td><strong><?php echo get_queried_object()->display_name; ?></strong></td>
    		</tr>
    		<tr>
    			<th><?php _e( 'Member for', QA_TEXTDOMAIN ); ?></th>
    			<td><?php echo human_time_diff( strtotime( get_queried_object()->user_registered ) ); ?></td>
    		</tr>
    		<tr>
    			<th><?php _e( 'Website', QA_TEXTDOMAIN ); ?></th>
    			<td><?php echo make_clickable( get_queried_object()->user_url ); ?></td>
    		</tr>
    	</table>
    
    	<?php
    	$answer_query = new WP_Query( array(
    		'author' => get_queried_object_id(),
    		'post_type' => 'answer',
    		'posts_per_page' => 20,
    		'update_post_term_cache' => false
    	) );
    
    	$fav_query = new WP_Query( array(
    		'post_type' => 'question',
    		'meta_key' => '_fav',
    		'meta_value' => get_queried_object_id(),
    		'posts_per_page' => 20,
    	) );
    	?>
    
    	<div id="qa-user-tabs-wrapper">
    		<ul id="qa-user-tabs">
    			<li><a href="#qa-user-questions">
    				<span id="user-questions-total"><?php echo number_format_i18n( $wp_query->found_posts ); ?></span>
    				<?php echo _n( 'Question', 'Questions', $wp_query->found_posts, QA_TEXTDOMAIN ); ?>
    			</a></li>
    
    			<li><a href="#qa-user-answers">
    				<span id="user-answers-total"><?php echo number_format_i18n( $answer_query->found_posts ); ?></span>
    				<?php echo _n( 'Answer', 'Answers', $answer_query->found_posts, QA_TEXTDOMAIN ); ?>
    			</a></li>
    		</ul>
    
    		<div id="qa-user-questions">
    			<div id="question-list">
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php do_action( 'qa_before_question_loop' ); ?>
    				<div class="question">
    					<?php do_action( 'qa_before_question' ); ?>
    					<div class="question-stats">
    						<?php do_action( 'qa_before_question_stats' ); ?>
    						<?php the_question_score(); ?>
    						<?php the_question_status(); ?>
    						<?php do_action( 'qa_after_question_stats' ); ?>
    					</div>
    					<div class="question-summary">
    						<?php do_action( 'qa_before_question_summary' ); ?>
    						<h3><?php the_question_link(); ?></h3>
    						<?php the_question_tags(); ?>
    						<div class="question-started">
    							<?php the_qa_time( get_the_ID() ); ?>
    						</div>
    						<?php do_action( 'qa_after_question_summary' ); ?>
    					</div>
    					<?php do_action( 'qa_after_question' ); ?>
    				</div>
    				<?php do_action( 'qa_after_question_loop' ); ?>
    			<?php endwhile; ?>
    			</div><!--#question-list-->
    		</div><!--#qa-user-questions-->
    
    		<div id="qa-user-answers">
    			<ul>
    			<?php
    				while ( $answer_query->have_posts() ) : $answer_query->the_post();
    					list( $up, $down ) = qa_get_votes( get_the_ID() );
    
    					echo '<li>';
    						echo "<div class='answer-score'>";
    						echo number_format_i18n( $up - $down );
    						echo "</div> ";
    						the_answer_link( get_the_ID() );
    					echo '</li>';
    				endwhile;
    			?>
    			</ul>
    		</div><!--#qa-user-answers-->
    
    	</div><!--#qa-user-tabs-wrapper-->
    
    	<?php do_action( 'qa_after_content', 'edit-question' ); ?>
    
            <div class="clear"></div>
        </div>
    
        <!-- Sidebar
          ================================================== -->
         <div class="qa-sidebar">
    
         <?
    
    	        /* Widget Area */ if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar('Questions Sidebar') );
    
            ?>
    
        </div>
    
        <div class="clear"></div>
    
    </div>
    <?php get_footer(); ?>

    I put it there and then edited it to fit with my theme, as I have done for the other pages.

  • Hakan

    That is a custom user-question page. Who made this for you? Did this problem start recently or maybe it was there and are you just noticing it?

    To check if problem is in this file:
    - Make a backup of this file, e.g. download it to your PC
    - Delete this file on your server and check again
    - Upload it back if nothing changes

    Also: Please open wp-config.php file and check if you see QA_SLUG_USER there.

    If these don't help, please send your admin and FTP credentials using our contact form:
    https://premium.wpmudev.org/contact/

    Please refer to my name and give a link to this post in your contact message.

    Cheers,
    Hakan

  • Hakan

    Hi,

    You are using several roles and capability manager plugins and probably one of them uses this format and limits access to those pages:

    http://example.com/post-type/user/hakan/

    It is difficult to determine which of them is causing this issue unless you deactivate all of them and reactivate them one by one or playing by their settings, which are a lot.

    Instead and to permanently solve the issue, I changed the question user page definition QA_SLUG_USER to "qa-user" in wp-config.php and those pages are accesible now. It means, from now on your question user pages are like:

    http://example.com/questions/qa-user/hakan/

    There is no problem of going on like this as Q&A will automatically adapt itself to this change and in the future you can safely update the plugin when a new version is released, that is, this change will not be overwritten.

    Cheers,
    Hakan

  • aecnu

    Greetings lewischeney,

    It appears this particular topic is now resolved/closed, if you need any further assistance please let us know.

    If it wasn't resolved, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Thank you for being a WPMU Dev Community Member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.