Skip to content

Unify Items and Customers CSV import headers and templates #4806

Open

Description

@coderabbitai

Summary

Unify CSV import handling for Items and Customers. The current customer import downloads a static template and compares headers in a fixed order. This follow-up will also prepare the customer import for the planned Person Attributes work.

Required changes

  • Generate the Customers CSV import template instead of relying on the static importCustomers.csv file, following the Items template approach.
  • Apply strict header naming requirements to both Items and Customers imports, without requiring a fixed column order.
  • Adjust import validation and business logic, including queued row processing, so each value maps to the correct field when columns are reordered.
  • Review compatibility with existing customer CSV files, including the legacy header labels raised in the review. Define how the strict naming requirement applies to those files.

Affected areas include the Items and Customers controllers, CSV template and import helpers, queued row processors, and CSV import tests.

Acceptance criteria

  • The Customers template is generated and can be downloaded and imported.
  • Both imports accept valid headers in a different column order and correctly save the corresponding values.
  • Both imports reject headers that do not meet the agreed strict naming requirements.
  • Automated tests cover generated templates, reordered columns, invalid headers, BOM handling, and the agreed legacy-file behavior for both imports as applicable.

Requested by @objecttothis.

Related pull request: #4725
Review comment: #4725 (comment)

Activity

  1. removed their assignment
    on Nov 9, 2026
  2. objecttothis commented on Nov 16, 2026

    @objecttothis
    Member

    Claude Issue Checker Agent (cc @objecttothis)

    Status: Still present / not yet implemented on master.

    app/Controllers/Customers.php on master still implements the legacy behavior this issue asks to unify away:

    • getCsv() just returns the static file WRITEPATH . "uploads/importCustomers.csv" rather than generating a template (unlike the Items approach referenced in the issue).
    • postImportCsvFile() parses rows strictly by fixed numeric column index ($data[0] … $data[17]) with no header-name validation or reordering support, which is exactly the fixed-column-order limitation the issue wants replaced with strict header-name matching independent of column order.

    No generated-template logic or header-name-based mapping exists in this controller.

    Confidence: High — based on direct inspection of the current app/Controllers/Customers.php source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions