Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#10978 closed defect (bug) (invalid)

get_queried_object bug for else/if statement is_author query.php

Reported by: eddiegomez's profile eddie.gomez Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

the else/if is_author block only checks for the existence of $this->get('author') - returning false in previously set permalinks where author is followed by the author name and not an ID,(eg, http://www.domainname.com/author/someauthor@domain.com). Changed block to check for both author and author_name:
else if ($this->is_author) {

if(!$this->get('author') && $this->get('author_name')){

$author = $this->get('author_name');

}else{

$author_id = (int) $this->get('author');
$author = get_userdata($author_id);

}
$this->queried_object = $author;
$this->queried_object_id = $author_id;

}

Change History (7)

#1 @eddie.gomez
14 years ago

  • Summary changed from get_queried_object bug for else/if statement is_author ln 2575 query.php to get_queried_object bug for else/if statement is_author query.php

#2 @scribu
14 years ago

Could you post your code in the form of a patch? It would be easier to review the changes.

See http://markjaquith.wordpress.com/2005/11/02/my-wordpress-toolbox/

#4 @eddie.gomez
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

nvrmnd - found true culprit - dont know if this is isolated incident - the problem with the author id not being set properly was because the user_nicename was being stored in our DB w/o special characters (I should say that our usernames are set out our company emails). The query variables we're not stripping the dot and thus in function &get_posts(), towards the bottom the block commented with " Author stuff for nice URLs" the user_nicename and $qauthor_name? where not matching. Went ahead and stripped out the dot in the author_name and that resolved the issue. Please ignore previous msg, I went ahead and reverted back the code and simply stripped out the dot in the username

#5 @scribu
14 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#6 @scribu
14 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

#7 @scribu
14 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.