WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#11061 closed defect (bug) (fixed)

Wrong term link when permalinks turned off

Reported by: scribu Owned by: ryan
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Permalinks Keywords: has-patch
Focuses: Cc:

Description

Site URL: http://localhost/wp

Permalinks: Default

Taxonomy: 'genre'

Expected result:

http://localhost/wp/?genre=jazz

Actual result:

http://localhost/wpgenre/jazz

Attachments (2)

term_links.diff (1.6 KB) - added by scribu 5 years ago.
11061.diff (593 bytes) - added by scribu 5 years ago.
remove double slash

Download all attachments as: .zip

Change History (13)

@scribu5 years ago

comment:1 @scribu5 years ago

  • Component changed from General to Permalinks
  • Owner set to ryan
  • Version set to 2.9

comment:2 @ryan5 years ago

See also #11179

comment:3 @ryan5 years ago

I think adding the slash to the add_permastruct() call will break pretty permas. The fix for #11179 should fix the slashing. That leaves returning pretty links when the crufty links should be returned. I think we can fix that by having get_extra_permastruct() return false if pretty links are not on, as is done with other get_*_permastruct calls.

comment:4 @ryan5 years ago

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

(In [12230]) Don't return extra permastructs if pretty permalinks not turned on. Props scribu. fixes #11061

comment:5 @ryan5 years ago

Try that out. Re-open if I messed it up. :-)

comment:6 @scribu5 years ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Slight glitch:

Permalinks off: http://localhost/wp/?genre=jazz (ok)

Permalinks on: http://localhost/wp//genre/jazz/ (notice the double slash after /wp)

@scribu5 years ago

remove double slash

comment:7 @scribu5 years ago

  • Keywords has-patch added; needs-patch removed

comment:8 @scribu5 years ago

$wp_rewrite->get_extra_permastruct($taxonomy); adds a slash at the beginning now, which is good.

That's what caused the extra slash.

comment:9 @scribu5 years ago

  • Cc scribu@… added

comment:10 @bookchiq5 years ago

  • Cc sarah@… added

comment:11 @ryan5 years ago

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

(In [12241]) Fix double slashing. Props scribu. fixes #11061

Note: See TracTickets for help on using tickets.