View Issue Details

IDProjectCategoryView StatusLast Update
0035180mantisbthtmlpublic2025-03-01 18:40
Reporterraspopov Assigned Tocommunity  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version2.27.0 
Target Version2.27.1Fixed in Version2.27.1 
Summary0035180: The MantisBT web interface must pass HTML validation
Description

It is very desirable that the HTML and CSS are flawless and pass the checks for example at https://validator.w3.org/. Current reports show a few bugs, lots of warnings and advisories, mostly due to a fairly old version of HTML. Poorly formatted HTML makes it difficult to develop themes, affects compatibility with browsers and non-computer devices, and has a bad effect on accessibility.

TagsNo tags attached.

Relationships

related to 0035424 resolvedcommunity Use new string_build_query() API function 
related to 0035493 closedcommunity Inactive buttons of project navigation bar are not clickable 
related to 0035503 resolvedcommunity The MantisBT web interface must pass HTML validation (part 2) 

Activities

raspopov

raspopov

2024-12-19 11:08

reporter   ~0069591

Fix for first error, PR 2057 Incorrectly placed <style> tag.

dregad

dregad

2024-12-19 11:57

developer   ~0069592

Thanks.

Do you intend to submit more changes like this ? If so I'd rather regroup them under this single issue, which can remain open until you're done or I'm ready to release 2.27.1 (whichever comes first).

raspopov

raspopov

2024-12-19 15:34

reporter   ~0069593

Yes, I'd like to suggest some more changes in the future, like setting a language for the <html> tag or unifying the output of widgets. It all started when I wanted to add a new button to check the SQLite database and saw inconsistent output of the same HTML markup in different files....

raspopov

raspopov

2024-12-20 09:19

reporter   ~0069594

PR 2058 for adding "lang" attribute of "html" tag.
And optimization fix.

dregad

dregad

2024-12-22 09:24

developer   ~0069597

PR 2057 and 2058 have been merged, thanks @raspopov.
I'm leaving this Issue open as discussed, let me know when you're done and I'll resolve it.

raspopov

raspopov

2024-12-22 11:02

reporter   ~0069598

Last edited: 2024-12-22 11:07

One thing confuses me, MantisBT defines the type of generated content as html, but some tags, for example <meta> or <br> use self closing slashes as if they were xml, for html this makes no sense and is even unacceptable. Is this an inaccuracy that needs fixing or was there an attempt to switch to xhtml?

dregad

dregad

2024-12-23 03:45

developer   ~0069599

Many years ago (before 1.3 was released), a former developer switched the doctype to strict XHTML (see 0012545), but that was causing more problems than anything else so I ended up reverting the change, and we ultimately switched to HTML5 (0016025).

So those are artefacts leftover from those days, feel free to fix them.

raspopov

raspopov

2025-01-29 10:13

reporter   ~0069766

When the width of page with "Upload Files" dropzone is reduced to 767px, the following rule from bootstrap-3.4.1.min.css is activated:

@media screen and (max-width: 767px) {
    .table-responsive>.table>tbody>tr>td, .table-responsive>.table>tbody>tr>th, .table-responsive>.table>tfoot>tr>td, .table-responsive>.table>tfoot>tr>th, .table-responsive>.table>thead>tr>td, .table-responsive>.table>thead>tr>th {
        white-space: nowrap;
    }
}

Which is unintentionally inherited by the dropzone <span> tag, as a result the text of this tag stops fitting and a scroll bar appears.

before.png (8,866 bytes)   
before.png (8,866 bytes)   
raspopov

raspopov

2025-01-29 10:16

reporter   ~0069767

The next interfering element is the <input> ‘Summary’ tag. Its size is set inside HTML using the size=‘105’ attribute.

This PR fixes both of the above problems: 2085.

These changes will allow the page width to be reduced to 460px, any more than that and the ‘Select Profile’ element starts to get in the way.

after.png (9,595 bytes)   
after.png (9,595 bytes)   
raspopov

raspopov

2025-02-10 10:31

reporter   ~0069842

MantisBT is irresponsible when building parameters for GET requests. The rawurlencode() function should be used everywhere. For example, the URL used for filtering uses unencoded characters "[" and "]" and violates RFC3986 requirements.

raspopov

raspopov

2025-02-11 12:44

reporter   ~0069852

Last edited: 2025-02-11 12:58

Some improvements: https://github.com/mantisbt/mantisbt/pull/2095

And next bunch of fixes: https://github.com/mantisbt/mantisbt/pull/2096

I noticed that the MantisBT unit tests failed on PHP 8.4, but this is a "master-2.27" branch that should not run on that version actually.

For local checking I use latest “Nu Html Checker” (version 24.12.23).

dregad

dregad

2025-02-12 06:16

developer   ~0069853

I noticed that the MantisBT unit tests failed on PHP 8.4, but this is a "master-2.27" branch that should not run on that version actually.

Yes, I merged the PHP 8.4 fixes into Master branch only so it's normal that they would fail in 2.27 branch.

Note: the 8.4 builds are considered "experimental" in the matrix, which will set the continue-on-error flag to prevent the overall build to fail. You will notice that the workflow runs are green in https://github.com/mantisbt/mantisbt/actions, but in the PR's checks tab for some reason it shows with a red X. With TravisCI we had an allow_failures option, but as far as I know there is no equivalent in GitHub Actions. This is a known and long-standing feature request with many upvotes, but as of today still not implemented.

For local checking I use latest “Nu Html Checker” (version 24.12.23).

Nice tool !

raspopov

raspopov

2025-02-13 12:11

reporter   ~0069857

This is a known and long-standing feature request with many upvotes, but as of today still not implemented.

Did you notice that a few hours after your post, discussions were continued and the following option was suggested? https://github.com/mainmatter/continue-on-error-comment

dregad

dregad

2025-02-21 17:53

developer   ~0069892

I did not, thanks for the heads up. I'll check if we can leverage the action somehow.

raspopov

raspopov

2025-02-26 11:08

reporter   ~0069925

More PR: https://github.com/mantisbt/mantisbt/pull/2110

Perhaps in the end it will be possible to package all the code for outputting pages, tables, etc. into a simple set of print functions. This will allow, for example, to easily change the template for forming tables from <table> to flex <div> (otherwise tables don't fit on smartphone screens).

dregad

dregad

2025-02-26 14:43

developer   ~0069929

@raspopov I'd like to release 2.27.1, hopefully by end of this week, so as previously mentioned in 0035180:0069592 I would prefer this Issue to remain closed with all the fixes that have already been merged, and you open another one targeted at 2.28.0 to track 0035180:0069925 / PR 2110 as well as any future fixes of this kind.

dregad

dregad

2025-02-26 19:00

developer   ~0069931

I created 0035503 to track continuation of this work item in 2.28.0.

Related Changesets

MantisBT: master-2.27 39e340e4

2024-12-19 15:17

raspopov

Committer: dregad


Details Diff
Fix invalid HTML

A <style> tag was incorrectly placed inside a <body> tag instead of a
<head> tag.

Issue 0035180, PR https://github.com/mantisbt/mantisbt/pull/2057

Signed-off-by: Damien Regad <dregad@mantisbt.org>
Affected Issues
0035180
mod - core/layout_api.php Diff File

MantisBT: master-2.27 4e49e931

2024-12-22 08:39

raspopov

Committer: dregad


Details Diff
Add the 'lang' attribute to the '<html>' tag

Uses new function lang_get_current_lang().

Improve PHPDoc for $g_language_auto_map.

Issue 0035180, PR https://github.com/mantisbt/mantisbt/pull/2058

Signed-off-by: Damien Regad <dregad@mantisbt.org>
Affected Issues
0035180
mod - config_defaults_inc.php Diff File
mod - core/html_api.php Diff File
mod - core/lang_api.php Diff File

MantisBT: master-2.27 5a12a854

2025-01-31 10:22

raspopov

Committer: community


Details Diff
Fix unnecessary scroll bar when scaling a page

Fixes 0035180, PR https://github.com/mantisbt/mantisbt/pull/2085
Affected Issues
0035180
mod - css/ace-mantis.css Diff File
mod - css/default.css Diff File

MantisBT: master-2.27 7d097dd7

2025-02-21 17:49

dregad

Committer: community


Details Diff
Fix HTML errors and warnings

Issues reported by Nu Html Checker:

- Error: Stray end tag i in filter_print_view_type_toggle()
- Error: Element option without attribute label must not be empty in
filter_draw_selection_area()
- Error: Row 7 of a row group established by a tbody element has no
cells beginning on it
- Warning: A table row was 0 columns wide, which is less than the column
count established by the first row (8) in filter_form_draw_inputs()
- Warning: The type attribute is unnecessary for JavaScript resources in
html_javascript_link(), - html_javascript_cdn_link() and
html_head_javascript()
- Error: Illegal character in query: [ is not allowed in my_view_inc.php
- Error: End tag for body seen, but there were unclosed elements in
lost_pwd_page.php
- Error: Unclosed element div
- Warning: Consider avoiding viewport values that prevent users from
resizing documents in layout_head_meta()
- Error: An img element must have an alt attribute, except under certain
conditions in layout_login_page_logo()
- Error: Element div not allowed as child of element ul in this context
in layout_breadcrumbs()

Add a new method TableGridLayout::render_spacer() to print a HTML code
for a spacer row of current table.

Add new function string_build_query() to string_api.php, a unified call
of http_build_query().

Moved the extra code from layout_page_begin() and layout_page_end() to
new paired functions layout_main_content_row_begin() and
layout_main_content_row_end().

Fixes 0035180, PR https://github.com/mantisbt/mantisbt/pull/2096
Affected Issues
0035180
mod - core/filter_api.php Diff File
mod - core/filter_form_api.php Diff File
mod - core/html_api.php Diff File
mod - core/layout_api.php Diff File
mod - core/string_api.php Diff File
mod - lost_pwd_page.php Diff File
mod - manage_proj_create_page.php Diff File
mod - manage_proj_edit_page.php Diff File
mod - manage_proj_page.php Diff File
mod - manage_tags_page.php Diff File
mod - my_view_inc.php Diff File

MantisBT: master-2.27 aacb4357

2025-02-21 18:06

raspopov

Committer: community


Details Diff
Add appropriate titles to login pages

Improvements for issue 0035180.

PR https://github.com/mantisbt/mantisbt/pull/2095
Affected Issues
0035180
mod - login_page.php Diff File
mod - login_password_page.php Diff File
mod - lost_pwd_page.php Diff File
mod - signup.php Diff File
mod - signup_page.php Diff File
mod - verify.php Diff File