Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Invalid tasks tree. Cyclic reference has been detected on task 0 if id=0 #117

Open
globdug opened this issue Jun 11, 2024 · 1 comment

Comments

@globdug
Copy link

globdug commented Jun 11, 2024

Hello,
I'm trying to import data from XML exported from MS Project.

Project's tasks ID start from 0, but if task ID is equal to 0 in the JSON file then I got the error "Error: Invalid tasks tree. Cyclic reference has been detected on task 0".

Is this a bug or an expected beheaviour?

Best regards,
Emanuele

@gearcoded
Copy link

@globdug,
Usually, the cyclic tree error means that the task has equal id and parent parameters or some child task is listed as the parent task:
https://docs.dhtmlx.com/gantt/faq.html#cyclicreferenceerror

However, in DHTMLX Gantt there is an invisible root task that is a parent of all tasks on the root level.
So, when you add a task with the 0 ID, it is assigned to the invisible root task, and its parent value becomes 0. So, it creates the cyclic tree.

To have a task with the 0 ID, you need to change the root_id config:
https://docs.dhtmlx.com/gantt/api__gantt_root_id_config.html

Here is an example in the snippet:
https://snippet.dhtmlx.com/vle0qtkd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants