Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 10 months ago

#3080 closed defect (bug) (fixed)

wp_list_pages() is not closing the </li> in some circumstances

Reported by: jeremyvisser's profile JeremyVisser Owned by: ryan's profile ryan
Milestone: 2.1 Priority: highest omg bbq
Severity: critical Version: 2.1
Component: Template Keywords: bughunt
Focuses: Cc:

Description

When wp_list_pages() is called limiting the depth of pages to be listed, it seems to be forgetting the closing </li> sometimes and invalidating the markup.

The arguments passed to it is 'sort_column=menu_order&depth=1&title_li=' and if I remove the depth=1 the markup will validate but will show all the pages, which is not what I want.

I can reproduce the error in the K2 theme, which uses the depth=1 argument.

I think the error is occurring in the Walker_Page class and could be related to #2668 but I don't have the PHP skills to be sure.

Attachments (1)

Picture 2.png (100.9 KB) - added by Michael 18 years ago.
binarybonsai.com static page structure

Download all attachments as: .zip

Change History (10)

#1 @ryan
18 years ago

  • Owner changed from anonymous to ryan

#2 @matt
18 years ago

  • Priority changed from normal to high

#3 @ryan
18 years ago

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

(In [4563]) Export file content type fixups from mdawaffe. fixes #3080

#4 @ryan
18 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Oops. Closed the wrong one.

#5 @ryan
18 years ago

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

(In [4564]) Close previous element when depth is hit. fixes #3080

#6 @Michael
18 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

I just got the trunk from SVN, and this problem is still in effect as far as I can tell. Same situation, same code.

Go to http://binarybonsai.com to see it (in the menu). I'll gladly send a screenshot of my static page structure, as I think that might be where wp_list_pages() stumbles.

@Michael
18 years ago

binarybonsai.com static page structure

#7 @markjaquith
18 years ago

  • Priority changed from high to highest omg bbq
  • Severity changed from normal to critical

Seems to be the opposite case: redundantly closed </li>

Here's what I see on Binary Bonsai:

<ul class="menu">
	<li class="current_page_item"><a href="http://binarybonsai.com/" title="Blog">Blog</a></li>
	<li class="page_item"><a href="http://binarybonsai.com/archives/" title="Archives">Archives</a></li>
	<li class="page_item"><a href="http://binarybonsai.com/wordpress/" title="WordPress">WordPress</a></li>
</li>
	<li class="page_item"><a href="http://binarybonsai.com/about/" title="About">About</a></li>
</ul>

#8 @Michael
18 years ago

Yes, my mistake in describing the issue.

#9 @ryan
18 years ago

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

(In [4779]) Walker fix ups. fixes #3080

Note: See TracTickets for help on using tickets.