Opened 15 years ago

Closed 15 years ago

#11252 closed (fixed)

Invalid XHTML when filtering a paginated list

Reported by: daemondazz Owned by: nobody
Component: contrib.admin Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The admin sites generates invalid XHTML when viewing a filtered list of objects and that list needs to be paginated. The invalid tags are the links for jumping to different pages in the result set which have query string like "?p=2&domain__exact=1" instead of "?p=2&domain__exact=1".

This manifests if the site has

DEFAULT_CONTENT_TYPE = 'application/xhtml+xml'

set in the settings file: Firefox displays an error message about the invalid XHTML code and is not able to show the page.

The culprit in this case is passing the results of urllib.urlencode directly back to the HTML without fixing the amperstands.

Patch to be attached in a moment.

Attachments (2)

django_admin_pagination_fixamperstands.patch (1.2 KB ) - added by daemondazz 15 years ago.
Patch to wrap the return of urllib.urlencode in fix_amperstands
django_admin_pagination_escape.patch (788 bytes ) - added by daemondazz 15 years ago.
Updated patch using escape()

Download all attachments as: .zip

Change History (8)

by daemondazz, 15 years ago

Patch to wrap the return of urllib.urlencode in fix_amperstands

comment:1 by Chris Beaven, 15 years ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted
Version: 1.0SVN

Should just use escape

by daemondazz, 15 years ago

Updated patch using escape()

comment:2 by daemondazz, 15 years ago

Update to use escape() as suggested.

comment:3 by Chris Beaven, 15 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:4 by daemondazz, 15 years ago

Any movement on this ticket? I still need to apply the patch against 1.1

comment:5 by Chris Beaven, 15 years ago

Bring up requests like this in the django developers google group.

If you wanted to make this patch better, you could write a test too.

comment:6 by Luke Plant, 15 years ago

Resolution: fixed
Status: newclosed

(In [11486]) Fixed #11252: Invalid XHTML when filtering a paginated list.

Thanks daemondazz

Note: See TracTickets for help on using tickets.
Back to Top