Page 1 of 2

Mantis doesn't validate XHTML -- not even close

Posted: 11 Feb 2007, 19:10
by jrmarino
I have embedded Mantis into my site, www.synsport.com, as I assume many others have. Normally I code all my web pages XHTML 1.0 Strict, but due to PHPBB (XHTML valid skin) and Mantis I had to drop down to XHTML 1.0 Transitional. Today I performed a validation check on my site using W3C validator and received a lot of errors, serious errors like nested forms, unclosed form tags, illegal tags, etc. Then I came to this site and performed a validation check on the mantis instance here, with the same results.

Has nobody bothered to validate these generated pages? This isn't a case where it was valid, then a tweak broke it. Are people aware of this, and is there any intention on providing XHTML 1.0 Transitional pages which the doctype dictates?

Posted: 12 Feb 2007, 19:33
by srouleau
Doesn't suprise me; I tried running Mantis behind a proxy, which rewrites the HTML as it goes through, and got all sorts of weird results. In the end I had to turn off rewriting completely.

Posted: 15 Feb 2007, 08:01
by vboctor
Initially Mantis was generating HTML and we did a lot of work to move it to XHTML. However, we haven't yet made it pass the validator checks. I would be happy to provide the appropriate access for someone to be able to commit changes that fix such XHTML compliance issues.

Posted: 27 Feb 2007, 12:30
by jrmarino
would you accept modified files from version 1.0.6 and use a diff program like winmerge to incorporate the submitted changes to the dev branch?

Posted: 27 Feb 2007, 18:08
by vboctor
Would it be easy for your to provide me with modified files against 1.1.0a2? I won't be applying XHTML compliance changes to 1.0.x branch and hence having it against the other branch will make it easier to apply.

Posted: 06 Mar 2007, 19:46
by jrmarino
honestly it would not be "easier" - since my production server is running 1.0.6, it would be "easier" to fix that and deliver the updated files.

I could be persuaded to update the production server to the latest beta if it was rock solid stable. However, I just read a post that a3 is coming out so I would wait until after then anyway.

so I'm kind of stuck -- I don't really want to install a dummy version especially since my dev server (at home under my desk) crapped out with a bad hard drive and I don't want to screw up a productive version either.

Posted: 08 Mar 2007, 15:23
by Narcissus
vb: if you don't have the time, I can give it a shot if you like... I've been knocking myself for not having done any work on Mantis for a while now, so something like that could be a good way to get reacquainted with the code.

Just let me know and we can tee everything up.

Posted: 08 Mar 2007, 15:28
by vboctor
Narcissus, that would be great. Please go for it :)

Posted: 08 Mar 2007, 15:44
by Narcissus
Excellent. jrmarino: I've sent you a PM with my email address so that we can work out the best way to do this.

Thanks.

Posted: 10 Mar 2007, 20:58
by jrmarino
The nested form problem is a nasty one.

I'm talking about the table of filters, for example, on the view all bugs page.
Here's how it's currently set up (briefly):

Code: Select all

<form>
  <table>
  {many rows}
    <tr>
        <td>search</form>
        <td>test</td>
        <td><form>reset filter</form><form>save filter</form></td>
    </tr>
  </table>
You can't do that.
The first </form> has to be outside the table.

The three options to fix this are:
  1. close the table, then the first form after the SEARCH option. Reset filter and save filter are outside this table, maybe in their own table below it.
  2. Change the code for save/reset filter to not require to be a form -- maybe use url variables instead of post variables. requires code change
  3. piggyback save/reset filter on the same form. There's no problem having 3 submit buttons for one form. requires code change.
This is not "nice" for XHTML, it's broken HTML. You can't have forms out of scope like that.

How would you like this fixed?

Posted: 15 Mar 2007, 09:05
by jrmarino
We're at a holding point here -- looking for direction.
I would recommend option 3.

Posted: 15 Mar 2007, 14:46
by Narcissus
Oops sorry: missed this.

Assuming vb has no preference either way, I would say I prefer option 3 as well.

Posted: 16 Mar 2007, 08:35
by vboctor
Option 3 while maintaining the same look and feel is fine by me.

Posted: 27 Mar 2007, 08:19
by jrmarino
Just an update here -

Option 3 is not going to work. First, there are more than 3 forms involved. There can also be a list of filters and a manage filters form. Secondly, there are at least 3 unique form targets.

One approach would be to use javascript to manipulate the master form values, including changing the form target. It gets a bit messy as the forms may or may not have add the variables defined, and some use variables commonly. In the case of the filter, it's both a dropdown and a hidden value.

For now, I'm going to fall back to trying to change the html elements with an attempt to maintain the current look.

Posted: 27 Mar 2007, 10:15
by jrmarino
Okay, I have fixed this with the HTML only. Please see here:

http://www.synsport.com/mantis/view_all_bug_page.php

This page validates and as far as I can tell, the filters work normally and *appear* to look as before. I did struggle to make it work in Firefox, Opera, IE 6, and IE 7 equally, but I finally did it.

Also note that the filter table had the colspan set incorrectly on the 5th and 6th row, 5th column. It was spanning 2 instead of the fourth column.


Honestly - it's terrible that the presentation and the code are mixed together like this. Splitting presentation out is what templates are for - this code is quite unnecessarily complicated due to having HTML conditions dispersed everywhere.