Back-office allows longer description than accepted at database level
- Dominant language
- PHP
- Stars
- 5
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Sentry Issue: [BACKEND-G1](https://sentry.io/organizations/lmem/issues/2647986007/?referrer=github_integration)
```
PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'description' at row 1
File "/public/index.php", line 28
$response = $kernel->handle($request);
...
(12 additional frame(s) were not displayed)
Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'description' at row 1
File "/public/index.php", line 28
$response = $kernel->handle($request);
...
(12 additional frame(s) were not displayed)
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'INSERT INTO matching_context (exampleUrl, urlRegex, excludeUrlRegex, description, querySelector, xpath, notice_id) VALUES (?, ?, ?, ?, ?, ?, ?)' with params ["https:\/\/www.amazon.fr\/Infantino-980-004915-00-projector-musical-mobile\/dp\/B00VAKUKC2\/ref=sr_1_7?__mk_fr_FR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&dchild=1&keywords=mobile+musical+b%C3%A9b%C3%A9&qid=1630306060&sr=8-7", ".*(\/dp)", null, "\/\/span[@id='productTitle']\/text()[contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ\u00c0\u00c2\u00c4\u00c7\u00c9\u00c8\u00ca\u00cb\u00ce\u00cf\u00d9\u00db\u00dc' , 'abcdefghijklmnopqrstuvwxyz\u00e0\u00e2\u00e4\u00e7\u00e9\u00e8\u00ea\u00eb\u00ee\u00ef\u00f9\u00fb\u00fc'), 'musical') and contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ\u00c0\u00c2\u00c4\u00c7\u00c9\u00c8\u00ca\u00cb\u00ce\u00cf\u00d9\u00db\u00dc' , 'abcdefghijklmnopqrstuvwxyz\u00e0\u00e2\u00e4\u00e7\u00e9\u00e8\u00ea\u00eb\u00ee\u00ef\u00f9\u00fb\u00fc'), 'mobile'] or \/\/span[@id='productTitle']\/text()[contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ\u00c0\u00c2\u00c4\u00c7\u00c9\u00c8\u00ca\u00cb\u00ce\u00cf\u00d9\u00db\u00dc' , 'abcdefghijklmnopqrstuvwxyz\u00e0\u00e2\u00e4\u00e7\u00e9\u00e8\u00ea\u00eb\u00ee\u00ef\u00f9\u00fb\u00fc'), 'musical') and contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ\u00c0\u00c2\u00c4\u00c7\u00c9\u00c8\u00ca\u00cb\u00ce\u00cf\u00d9\u00db\u00dc' , 'abcdefghijklmnopqrstuvwxyz\u00e0\u00e2\u00e4\u00e7\u00e9\u00e8\u00ea\u00eb\u00ee\u00ef\u00f9\u00fb\u00fc'), 'doudou'] or \/\/span[@id='productTitle']\/text()[contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ\u00c0\u00c2\u00c4\u00c7\u00c9\u00c8\u00ca\u00cb\u00ce\u00cf\u00d9\u00db\u00dc' , 'abcdefghijklmnopqrstuvwxyz\u00e0\u00e2\u00e4\u00e7\u00e9\u00e8\u00ea\u00eb\u00ee\u00ef\u00f9\u00fb\u00fc'), 'musical') and contains(translate(., 'ABCDEFGHIJKLMNOPQRSTUVWXYZ\u00c0\u00c2\u00c4\u00c7\u00c9\u00c8\u00ca\u00cb\u00ce\u00cf\u00d9\u00db\u00dc' , 'abcdefghijklmnopqrstuvwxyz\u00e0\u00e2\u00e4\u00e7\u00e9\u00e8\u00ea\u00eb\u00ee\u00ef\u00f9\u00fb\u00fc'), 'peluche']", null, null, 2232]:
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'description' at row 1
File "/public/index.php", line 28
$response = $kernel->handle($request);
...
(14 additional frame(s) were not displayed)
```
Contributor guide
Research direction
Start from the matching_context insert shown in the error and trace the description field from the back-office request through the backend mapping; /public/index.php is only the reported entry point. Determine where the accepted length differs from the database limit, then verify that an oversized description is handled consistently without the SQL exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php, symfony
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100