MySQL Strict Mode error while creating project

427
Defect
Erwin
Jack
3.5.2
3.5.1
-
Fixed
Normal
Blocker
3 years ago
2 years ago
0

Description

Hello,

I was creating a test project on Traq 3.5.1 in the Admin CP. I filled all fields, but forgot to set the display order. The result was the following SQL error:

Incorrect integer value: '' for column 'displayorder' at row 1
INSERT INTO `projects` (`name`, `codename`, `slug`, `info`, `enable_wiki`, `default_ticket_type_id`, `default_ticket_sorting`, `displayorder`, `private_key`) VALUES('Test SQL', 'SQL', 'test-sql', 'Projet de test', '0', '1', 'ticket_id.asc', '', 'd4c4031468caa4dc07b2f71a4c31979188d42ee1')

To reproduce this, go the /admin/projects/new in the admin CP and do not fill the display order field. You will also need to run MySQL in strict mode (for instance, add 'sql_mode = "ANSI,TRADITIONAL' to your MySQL configuration file).

I think you should properly cast this value as an integer before inserting it into the query.

And, perhaps, you should ensure you cannot set the same value for each project, which appears to be the case.

I am running a development install based on Wamp 2.2E with Apache 2.2.22, PHP 5.3.13 and MySQL 5.5.24.

Ticket History

2 years and 11 months ago by Jack

  • Changed Severity from Normal to Blocker
  • Changed Status from New to Accepted
  • Assigned ticket to Jack

Sorry it has taken so long for me to actually accept this, been busy with development on 4.0.

2 years and 11 months ago by Jack

  • Closed ticket as Fixed