Problem/Motivation
The name of the Ticket entity is set to a max length of 50. However it does not check if the calculated name based on the product title, throwing an SQL error for the user.
Steps to reproduce
Create a product with a name longer than 43 (50 - strlen("Ticket")).
Attempt to purchase with ticket to be created.
Enjoy: Drupal\Core\Entity\EntityStorageException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'name' at row 1:
Proposed resolution
See attached patch. Alternatively or as well could increase the length of the name field.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3218870-ticket-name-length.patch | 778 bytes | maxwellkeeble |
Comments
Comment #2
maxwellkeeble commentedAttached patch.
Comment #3
pcambraWe should maybe review why the error happens in terms of the data definition
Comment #4
pcambraComment #5
pcambraComment #6
pcambraComment #8
pcambraComment #10
pcambraMany thanks for your contribution @maxwellkeeble! I've pushed this as it is for 1.x and added it with tests for 2.x