Skip to content

Common Pitfalls Checklist ​

Quick pre-PR checklist covering the most frequent mistakes when building Labmin LIMS modules.

Routing & requests

  1. Unregistered controllers: Every non-default controller (including every submodule controller) must be listed in controllers: inside the module's index.php, otherwise requests return 404.
  2. Missing raw=1 or download on file links: Plain <a href> downloads without raw=1 come back wrapped in the LIMS HTML shell; without download (or target="_blank" for inline previews), the LIMS "Loading" overlay stays stuck.
  3. Using ajaxAction() for forms: ajaxAction() sends JSON and skips LimsRouter's $_POST HTML-entity decoding and blank-to-null conversion. Use postForm() / postFields() for forms and standard mutations.
  4. Redirecting on POST: Never return Router::redirect() from a Fusion POST action — return JsonResponse and let the Angular view call navigate() and toastStore.success().
  5. Using navigate() for external modules: navigate() and fusionLink are for ?feature=... routes inside the current module. Links to another module or a back URL need a plain <a href> / window.location.href.

Security, state & data

  1. UI-only authorization: Hiding a button in Angular is only UX. Always re-check CurrentUser::can() and workflow state inside Core/Services/ and throw an HttpException (403 / 409).
  2. Forgetting module scoping on FileStorage::get(): Always pass your module key as the second argument ($fs->get($ref, 'orders')) so references from other modules cannot be downloaded.
  3. Using feature flags for permissions: Flags have no Master exception and control feature availability, not who is authorized. Put permissions in access_config.php.
  4. Breaking module boundaries: Never import from another module's (or sibling submodule's) Core/, UI/, or Database/. Only import from Export/.
  5. Hand-editing shared migrations: Never edit a migration already committed or applied on a shared database. Generate a new migration at ?feature=migrations.
  6. Returning raw DateTimeImmutable in JSON props: Implement JsonSerializable on read DTOs so dates reach Angular as 'Y-m-d' / 'Y-m-d H:i' strings.

Frontend & UX polish

  1. Destructive confirm focus: Pass defaultFocus: "reject" to ConfirmationService.confirm() for deletes and archives so pressing Enter never destroys data.
  2. Stale dialog forms: Wrap modal <form> markup in @if (open()) { ... } so inputs reset cleanly on reopen.
  3. Forgotten ngModel fields in postForm(): Pass <fusion-select> / <fusion-datepicker> signal values via postForm's third extra argument.
  4. 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.

Labmin LIMS Module Developer Documentation