I am trying to setup the basic gantt chart using a database connector with a PDO connection following the How to Start instructions. When I make changes or create a new task I do not see the changes saved in the database, and when I try to create a link between two tasks I receive this alert:
Error type: LoadXML
Description: Incorrect XML
I’m not sure if this is related but I had to manually create a record in the database to get the + buttons to work. Otherwise I received a TypeError: ‘undefined’ is not an object (evaluating ‘date.getFullYear’) when trying to create a new Task in an empty chart.
Here is my client code…
gantt.config.xml_date = "%Y-%m-%d %H:%i";
var dp=new dataProcessor("nim/n_show_gantt_data.php");
Here is my server code…
include 'n_proj_connect_pdo.php'; //RETURNS $db_res as resource
$gantt = new JSONGanttConnector($db_res, "PDO");
target to a BIGINT instead of just INT
You need to have id field in both tables as auto-increment
The bigInt value is a temporary ID from client side, and it is expected that it will be replaced with DB generated ID during saving
I believe the link was trying to save the BIGINT because the gantt_task had actually failed saving. I do have the id’s auto-incrementing but since it failed saving the task due to an invalid sortorder the task was available in the UI but the DB never created an ID for it. Therefore, when I went to add the link it was using the temp BIGINT id as the target and failing again. Once I fixed the sortorder field and had the gantt_tasks saving properly the gantt_links worked.