Data store name unicity check missing

Hello,

It seems to be possible to create via gantt.createDatastore() a second store named after gantt.config.resource_store, the same as a previously-existing one, instead of replacing the latter!

The consequence is that, after wiping out data via gantt.clearAll() and filling the new store with fresh data, then, upon refreshing said resource store, the “resourceGrid” and “resourceTimeline” are emptied, probably because dhtmlxGantt uses the 1st one named gantt.config.resource_store in the list of stores as the resource store instead of preventing several stores to be named equally.

Since stores can be retrieved by their name those should be used as unique identifiers and thus we have lost a lot of time realizing that there was possibly a bug there…

Hello,
Thank you for detailed information.
I was able to reproduce it and added it as a bug in our tracker. The fix won’t be included in the upcoming update but it should be fixed in future releases.

Thanks @ramil!

A simple temporary workaround consists in checking existence of the store via gantt.getDatastore() before creating a store named equally.

Hello,
Sorry, that I didn’t inform you earlier, but the bug with the datastore was fixed in the 6.1.2 version:
https://docs.dhtmlx.com/gantt/whatsnew.html#612
You can test that it is no longer reproduced in the following snippet:
http://snippet.dhtmlx.com/a0f2f27a1