Code

Opened 7 years ago

Closed 7 years ago

#4527 closed (fixed)

Form.as_p produces invalid XHTML for rows with errors

Reported by: SmileyChris Owned by: adrian
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

...
<p><ul class="errorlist"><li>This field is required.</li></ul></p>
<p>Last name: <input type="text" name="lname" maxlength="30" /></p>
...

<p> elements can only contain inline and "text-level" elements (DTD).

Easy fix attached.

Attachments (1)

as_p.diff (618 bytes) - added by SmileyChris 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by SmileyChris

comment:1 Changed 7 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by mtredinnick

I'm slightly in two minds about whether this is the right fix, or whether we should be changing the way errors are rendered (so that they aren't HTML lists in this case). The latter change is a lot more intrusive and these are helper methods anyway, so I've gone with the patch from Chris, but it may not be universally loved.

comment:3 Changed 7 years ago by mtredinnick

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

(In [5518]) Fixed #4527 -- Changed the way errors are displayed in Form.as_p() to avoid
invalid XHTML constructs. Based on a patch from SmileyChris.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.