Appearance
Common Pitfalls Checklist
Quick pre-PR checklist covering the most frequent mistakes when building Labmin LIMS modules.
Routing & requests
- Unregistered controllers: Every non-default controller (including every submodule controller) must be listed in
controllers:inside the module'sindex.php, otherwise requests return404. - Missing
raw=1ordownloadon file links: Plain<a href>downloads withoutraw=1come back wrapped in the LIMS HTML shell; withoutdownload(ortarget="_blank"for inline previews), the LIMS "Loading" overlay stays stuck. - Using
ajaxAction()for forms:ajaxAction()sends JSON and skipsLimsRouter's$_POSTHTML-entity decoding and blank-to-null conversion. UsepostForm()/postFields()for forms and standard mutations. - Redirecting on POST: Never return
Router::redirect()from a Fusion POST action — returnJsonResponseand let the Angular view callnavigate()andtoastStore.success(). - Using
navigate()for external modules:navigate()andfusionLinkare for?feature=...routes inside the current module. Links to another module or abackURL need a plain<a href>/window.location.href.
Security, state & data
- UI-only authorization: Hiding a button in Angular is only UX. Always re-check
CurrentUser::can()and workflow state insideCore/Services/and throw anHttpException(403/409). - Forgetting
modulescoping onFileStorage::get(): Always pass your module key as the second argument ($fs->get($ref, 'orders')) so references from other modules cannot be downloaded. - Using feature flags for permissions: Flags have no Master exception and control feature availability, not who is authorized. Put permissions in
access_config.php. - Breaking module boundaries: Never import from another module's (or sibling submodule's)
Core/,UI/, orDatabase/. Only import fromExport/. - Hand-editing shared migrations: Never edit a migration already committed or applied on a shared database. Generate a new migration at
?feature=migrations. - Returning raw
DateTimeImmutablein JSON props: ImplementJsonSerializableon read DTOs so dates reach Angular as'Y-m-d'/'Y-m-d H:i'strings.
Frontend & UX polish
- Destructive confirm focus: Pass
defaultFocus: "reject"toConfirmationService.confirm()for deletes and archives so pressing Enter never destroys data. - Stale dialog forms: Wrap modal
<form>markup in@if (open()) { ... }so inputs reset cleanly on reopen. - Forgotten
ngModelfields inpostForm(): Pass<fusion-select>/<fusion-datepicker>signal values viapostForm's thirdextraargument. - Skipping the production build (
npm run build): Always run a production build before committing — Vite dev mode skips full Angular strict-template (strictTemplates: true) and TypeScript (strict: true) checks.