Skip to content

Issue 453 454 Stray Div Broke Page Layout

Ed Mozley edited this page Nov 29, 2026 · 2 revisions

🧱 #453 / #454 One stray </div> broke the layout of every analyst page

GitHub #453 and #454, reported by @pappas81 · every module · broke in 5.12.0, fixed in 5.12.1 (#3229-#3231)

What you saw

After upgrading to 5.12.0:

  • Tickets → Settings was empty under the header: no tabs, no list, nothing.
  • System → Analysts started half a screen down, under a large empty space.

Other pages could be affected in the same way, depending on how each one is laid out.

What was wrong

It was one HTML tag, not CSS. 5.12.0 added the Signed-in devices dialog to the avatar menu (#443). The header that draws that menu, includes/waffle-menu.php, is shared by every analyst page, and the dialog's markup ended with one </div> too many:

<div class="account-modal" id="devicesModal">
    <div class="account-modal-box devices-box">
        ...
    </div>
</div>
</div>   <!-- this one closed nothing of its own -->

A browser that meets a </div> with nothing of its own to close ends the nearest open box instead. Here that was the box the page lays itself out in, so everything that came after the header was drawn outside the layout it was written for. Tickets → Settings uses a grid that drew nothing at all, and Analysts got a block of empty space above it.

The fix

The tag is gone. No stylesheet changed, so no other page's layout can move because of this fix: every page now gets exactly the markup it was written for.

Checking everywhere else

Two new tests, and both fail on the 5.12.0 header, pointing at the devices dialog:

  • tests/template-div-balance.php reads every PHP template (436) and checks that its own HTML opens and closes the same number of <div>s. It needs no install, so it runs in CI on every push. Four header and footer pairs are deliberate (each help _top.php opens three boxes and its _bottom.php closes them, and the portal's header and footer do the same with one box). They are listed with their exact counts.
  • tests/page-div-balance.php signs in as an administrator on a test install and fetches 124 real pages: every module's main page, every settings page, every System card and every debug tool. It checks the HTML each one actually sends.

All of them balance with the fix. Every settings page and System card was also opened in a browser and measured for where its content starts under the header. The check found one more, older problem: System → Branding opened scrolled down past its own heading. Its sign-in preview is the real sign-in page in a frame, and that page's email box had autofocus, so the browser scrolled the Branding page to show the box. In the preview, neither sign-in page autofocuses now; the real sign-in pages still do.

The second part of #453, mail checking that spins for ever, is not explained by this tag. Nothing in 5.12.0's mail checking hangs on the test install, and the mailbox tests pass.

📁 Files

File Change
🔴 includes/waffle-menu.php The stray </div> after the Signed-in devices dialog removed
🟡 auth/login.php, self-service/login.php No autofocus in the Branding preview
🟢 tests/template-div-balance.php New, static, in CI
🟢 tests/page-div-balance.php New, against a test install
🟣 .github/workflows/web-exposure.yml Runs the static test

What this means for you

Upgrade to 5.12.1, run Database Verification (it finds nothing to change) and hard-refresh (Ctrl-F5).

Related

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally