Skip to content

increment_id column in sales_order table too short? #34521

Closed
@hans-vereyken

Description

@hans-vereyken

While testing a marketplace integration we stumbled upon the fact that the 3rd party extension is expecting the increment_id to be 50 characters. It tries to save an increment_id of > 32 characters into the sales_order column. It's an easy workaround, but it feels like an oversight in the Magento core code:
Looking at all increment_id columns and there length, only sales_order.increment_id has a length of 32, all the others have a length of 50:
tablename:increment_id-field-length
sales_order:32
sales_order_grid:50
sales_shipment:50
sales_shipment_grid:50
sales_invoice:50
sales_invoice_grid:50
sales_creditmemo:50
sales_creditmemo_grid:50

The difference between sales_order an sales_order_grid bothers me the most :-)
Also increment_id columns in other modules (eg: Customer) have a length of 50.
Is it an oversight or is there a good reason for the sales_order.increment_id to be only 32 characters in length? For me it's a bug.
Thx to https://github.com/vacla He found the bug.

Preconditions (*)

  1. Magento 2.4.x (2.4-develop)

Steps to reproduce (*)

  1. Install certain 3rd party modules assuming sales_order.increment_id has a length of 50 characters

Expected result (*)

  1. An increment_id of 50 characters is save completely

Actual result (*)

  1. Only 32 characters of an increment_id of 50 characters is saved

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Area: OrderIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: doneReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions