Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#4683 closed defect (bug) (fixed)

category dropdown javascript wrong location after moved blog

Reported by: pastinakel's profile Pastinakel Owned by:
Milestone: 2.2.2 Priority: normal
Severity: normal Version: 2.2.1
Component: General Keywords: category dropdown moved has-patch
Focuses: Cc:

Description

After moving the blog address to a different location from the wordpress address, the categories dropdown gives a 404 because it uses a wrong value.

Condition:
This happens only when the location of wordpress is not the same as the blog's location, i.e.

get_option('siteurl') != get_option('home')

Example:
Blog: http://www.mysite.net/
WP: http://www.mysite.net/wordpress/
Dropdown points to: http://www.mysite.net/wordpress/?cat=1
Dropdown should point to: http://www.mysite.net/?cat=1

Caused by:
wp-includes/widgets.php:633

location.href = "<?php echo get_option('siteurl'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;

Fix:
wp-includes/widgets.php:633

location.href = "<?php echo get_option('home'); ?>/?cat="+dropdown.options[dropdown.selectedIndex].value;

Attachments (1)

widgets.php.diff (249 bytes) - added by Pastinakel 17 years ago.
diff

Download all attachments as: .zip

Change History (6)

@Pastinakel
17 years ago

diff

#1 @foolswisdom
17 years ago

  • Keywords has-patch added
  • Milestone set to 2.3 (trunk)

#2 @markjaquith
17 years ago

Pastinakel, thanks for the report and the patch! In the future could you please provide us with unified diffs make from the root WP directory?

If you use Subversion, you can just:

cd wordpress
svn di > ~/desktop/patch.diff

#3 @markjaquith
17 years ago

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

(In [5823]) Use "home," not "siteurl" for widget dropdown category URLs. Props Pastinakel. fixes #4683 for trunk

#4 @markjaquith
17 years ago

  • Milestone changed from 2.3 (trunk) to 2.2.2
  • Resolution fixed deleted
  • Status changed from closed to reopened

#5 @markjaquith
17 years ago

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

(In [5824]) Use "home," not "siteurl" for widget dropdown category URLs. Props Pastinakel. fixes #4683 for 2.2.x

Note: See TracTickets for help on using tickets.