Support Forum
Test case should be runnable, so we can unzip it, open in browser, and it should work with no errors. The archive shouldn't contain any libraries (ext, sch, gnt etc). We will include them by ourself and fix paths in index.html. Then we need some steps to run to be able to reproduce the issue.Dev_Coppelis wrote:and i can't understand how to upload the code can you refer to which files should be removed from the snapshot that i provided before
To create a test case please take any of our examples as a base and change it with minimum code until you can reproduce the error. As soon the error is reproduced, please zip up the sample you've modified, and attache to the post here. We will check it and try to figure out the reason of the failure.
Before you attach the archive you can check it to make sure it's reproducible. To do that you need to unzip the archive and try to run it yourself.
I hope this guidance will help you.
Cheers,
Pavlo Miklashevych
Sr. Frontend Developer
i found that the error is because of the calenders that returned back from back-end.pmiklashevich wrote:Also I've checked the code. The error happens in Sch.data.Calendar.convertMSDurationToUnit when it tries to read property DAY of this.unitsInMs.this.unitsInMs is null by default, but it's get filled with values in constructor. So need to debug to see why it's not filled up.this.unitsInMs['DAY']
i removed this line form ganttCrudController in load function
if (loadRequest.calendars != null) loadResponse.setCalendars(gantt.getCalendars(), 1);
but the sync function are not called
till now i can't understand how to send you a demo to test
but i will tell you the steps that i made
in MSProjectGantt :
1) i added the following line of code to enable crud operation with gantt.
-- then tried it and it make load operation successfully.
in BryntumMPPReader project :
1) after importing .mpp file and has been parsed the returned json contains a task object and this object has my tasks as a children but this causes an error in mapping because my tasks's parentId is set to the object task so i returned just the childs ( my own tasks ) without its parent and this solved the issue.
now i tried to upload mpp file it gives me the error about can't read value day of null that explained earlier and the response was :
i removed the line that returns calendar data in load function
and the error was gone.
but after doing all of that the data are imported successfully and saved to database but the only issue is if i double clicked on any task to make an edit but i didn't change its value the duration of the top parent task are changed from 151 to 183 days ( mpp file is attached ).
before trying to edit : after trying to edit : but to solve the recalculation that happened i made this change.
in MSImportPanel.js :
in success event handler i wrote this
before firing dataavailable event.
but it thorws an exception which is :
I hope that every thing is clear now
but i will tell you the steps that i made
in MSProjectGantt :
1) i added the following line of code to enable crud operation with gantt.
var crud = new Gnt.examples.msproject_import.crud.CrudManager({ taskStore : taskStore });
in BryntumMPPReader project :
1) after importing .mpp file and has been parsed the returned json contains a task object and this object has my tasks as a children but this causes an error in mapping because my tasks's parentId is set to the object task so i returned just the childs ( my own tasks ) without its parent and this solved the issue.
now i tried to upload mpp file it gives me the error about can't read value day of null that explained earlier and the response was :
in GanttCrudController :Also I've checked the code. The error happens in Sch.data.Calendar.convertMSDurationToUnit when it tries to read property DAY of this.unitsInMs.this.unitsInMs is null by default, but it's get filled with values in constructor. So need to debug to see why it's not filled up.this.unitsInMs['DAY']
i removed the line that returns calendar data in load function
//if (loadRequest.calendars != null) loadResponse.setCalendars(gantt.getCalendars(), 1);
but after doing all of that the data are imported successfully and saved to database but the only issue is if i double clicked on any task to make an edit but i didn't change its value the duration of the top parent task are changed from 151 to 183 days ( mpp file is attached ).
before trying to edit : after trying to edit : but to solve the recalculation that happened i made this change.
in MSImportPanel.js :
in success event handler i wrote this
action.result.data.calendars = { children: action.result.data.calendars.children, metadata: action.result.data.calendars.metadata };
but it thorws an exception which is :
I hope that every thing is clear now