#427 - MySQL Strict Mode error while creating project
Type Defect
Status Fixed
Milestone 3.5.2
Version 3.5.1
Component -
Priority Normal
Severity Blocker
Owner Erwin
Assigned to Jack
Reported 10 years ago
Updated 10 years ago
Votes 0
Related tickets
Proposed time
Worked time

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

10 years and 1 month ago by Jack

  • Severity Normal Blocker
  • Status New Accepted
  • Assigned to Jack

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

Jack closed as Fixed 10 years ago