Ticket #3080 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: JeremyVisser Assigned to: ryan
Priority: highest omg bbq Milestone: 2.1
Component: Template Version: 2.1
Severity: critical Keywords: bughunt
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

Picture 2.png (100.9 kB) - added by Michael on 01/19/07 23:26:33.
binarybonsai.com static page structure

Change History

08/30/06 03:29:20 changed by ryan

  • owner changed from anonymous to ryan.

11/30/06 22:59:08 changed by matt

  • priority changed from normal to high.

12/01/06 00:11:45 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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

12/01/06 00:14:02 changed by ryan

  • status changed from closed to reopened.
  • resolution deleted.

Oops. Closed the wrong one.

12/01/06 00:38:27 changed by ryan

  • status changed from reopened to closed.
  • resolution set to fixed.

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

01/19/07 23:25:54 changed by Michael

  • status changed from closed to reopened.
  • resolution deleted.

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.

01/19/07 23:26:33 changed by Michael

  • attachment Picture 2.png added.

binarybonsai.com static page structure

01/20/07 06:35:19 changed by markjaquith

  • 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>

01/20/07 07:58:25 changed by Michael

Yes, my mistake in describing the issue.

01/22/07 07:05:49 changed by ryan

  • status changed from reopened to closed.
  • resolution set to fixed.

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