Recurring events - server side logic.

I do now have a prototype website available with this problem on it.

I do not want to advertise this website on the forum as it is still under development and I would need to give instructions as how to use it.

Can you provide me with an email address to send instructions too.

Thanks,

Hello,

support [at] dhtmlx.com
Please include link to this topic.

Kind regards,
Ilya

Info sent

Just drop me a memo if you need any more information - I must be doing something wrong here as the problem seems so fundemental.

Thanks

Hello, Nigel.

Thank you for the sample, much easier that way.
Found the problem, that was quite interesting: in ‘onBeforeEventDelete’ recurring.js logic added new event with addEvent where your code sent data to the server and changed it’s id but recurring.js didn’t knew about it and later on called another function with the old id.
I’ve modified the code and attached updated version, does it work correctly now?

Kind regards,
Ilya
dhtmlxscheduler_recurring.zip (5.99 KB)

Note: Info also sent to support site with login details:

I have now got round to trying your fix ‘recurring.js’ file for this problem and I now get further but there are still some issues.

a) If I set up a recurring event then open an individual event and delete it, the ‘id’ sent in the ‘delete’ does not match any ‘id’ on the server and therefore fails.

b) If I set up a recurring events then open an individual event and ‘change the text’ on ‘save’ the screen locks up.

Note: Because of these issues not all the server logic has been tested.

thanks for any help

Hello,

If you delete one event from the series then actually 1 record should be added to the database, I believe we’ve discussed this.

Please open ticket in our support system (you need license) so I could look into this case.

Kind regards,
Ilya

Ok I will look at raising a ticket on this issue but just on the delete case above - I understand that you add an event to the database but you are actually adding an event and then trying to delete an event with an invalid ‘id’.

Hello,

Try using attached file, does it help with described issues?

I meant support system, not our email :slight_smile: While we strive to be as helpful as possible on the forums and love feedback and bug reports yet we provide support as a service through support system for our customers who purchased license.

Best regards,
Ilya
dhtmlxscheduler_recurring.zip (4.87 KB)

Thanks for the new file - unfortunatley it does not seem to have solved the two issues with recurring events.

I understand what you meant about raising the ticket and the license.

I am working on a project for a small startup who want to see a working demo before going forward with the real development so I need to talk to them about paying for a license.

FYI:

I have managed to get some debug information for one of the problems - hope this might help.


b) If I set up a recurring events then open an individual event and ‘change the text’ on ‘save’ the screen locks up.

Debug info - IE9

SCRIPT5007: Unable to set value of the property ‘_pid_time’: object is null or undefined
dhtmlxscheduler_recurring.js, line 1 character 5009

Debug info - FF:

ev is undefined
localhost:8080/scheduler/ext/dht … curring.js
Line 250

I have done a little debugging on IE9 fault - save individual event from series locks up the screen with fault:

Unable to set value of the property ‘_pid_time’: object is null or undefined
dhtmlxscheduler_recurring.js, line 1 character 5009

Without fully understanding the code I think I can see what is going wrong.


scheduler.attachEvent("onEventChanged",function(H){
    if(this._loading){
        return true
    }
    var F=this.getEvent(H);
    if(H.toString().indexOf("#")!=-1){
        var H=H.split("#");

(Set G to new uid)


        var G=this.uid();

        this._not_render=true;
        var E=this._copy_event(F);

(Set E.id to G)


        E.id=G;

        E.event_pid=H[0];
        E.event_length=H[1];
        E.rec_type=E.rec_pattern="";

(addEvent calls the server and changes the id to be the one returned from the server)


        this.addEvent(E);
        this._not_render=false;

(Try and find G but id is now the id returned from the server so undefined)


        this._add_rec_marker(this.getEvent(G),H[1]*1000)

It appears that the id returned from the server should be used in the ‘this.getEvent’ above.

Hope this helps.

Hello, Nigel.

Please try again using attached file.

Kind regards,
Ilya
dhtmlxscheduler_recurring.zip (17.7 KB)

Thanks very much this has solved the lockup on ‘saving’ the individual event from a series.

The ‘save’ and ‘delete’ of the individual event from a series now suffer from the same issue.

Here is the sequence to the server for the ‘save’ case but the ‘delete’ case suffers a similar issue.

Create a series of events ADD – id = 1308730741383, id returned from server = 10

Open and ‘Save’ individual event from a series
- ADD event to server with id = 1308730741385
- event_pid = 10
- Id returned from the server = 11

I then see a ‘change’ to the server with id=’10#231308852900’
- event_pid = 10

The ‘change’ will fail as the ‘id’ does not exist on the server – I am also not sure what this ‘change’ is really trying to do ?

If you need anymore information let me know.

FYI

The ‘change’ to the server has the following content:

event_pid = 10
event_length = null
rec_type = “”

Which seems rather odd.

Hello, Nigel.

I’ve tried to check it on your site which your earlier emailed us and notice that you still using previous dhtmlxscheduler_recurring.js file.
I’ve attached updated one (which I’ve included before) but now it’s uncompressed version so it would be easier to debug.
Can you please put it on your site so I could change what is wrong there?

Best regards,
Ilya
dhtmlxscheduler_recurring.zip (5.28 KB)

Thanks - yes I have been working on a local version.

I have just tried the file you have sent on my local site before uploading it but I am getting an error very early in the sequence out of IE9.

SCRIPT438: Object doesn’t support property or method ‘getElementsByTagName’
dhtmlxscheduler_recurring.js, line 11 character 3

and when I open the lightbox you get ‘undefined’ under ‘repeat events’.

Do I need to change something else ?

Once i have this working I will upload to my internet site.

I have decided to load the website (you can use the login I sent you) with the previous version of the file you sent me as this works on IE/FF and Safari and shows the problem as I described above - in two posts on this thread on Wed Jun 22.

While testing this locally I noticed one other thing of note - if you try ‘saving’ or ‘deleting’ an individual event from a series on IE9 you get a failure due to the ‘id’ being eg.
’10%231308852900’ but on FF this is seen as ’10#1308852900’.
In the FF case the server sees this id=’10’ because ‘#’ is taken as the end of the URL.
I think the last issue is just a quirk of the ‘#’ coding but it explains why we get different behaviour with IE and FF.

I am still very confused why the id with the hash is needed at all sent to the server.

Any progress ? thanks

Was this issue resolved? I see the same issue with the sample code from dhtmlxScheduler_v30_120111, in the file 01_recurring_events.html

I have not modified any thing in the Javascript, PHP or mySQL database. Everything is as-is clean from the samples folder. Except in the file 01_recurring_events.html
I replaced the minimized version of recurring and scheduler js with full source code.

Running this in Firefox 10.0.1

Debugging in Firebug I got this far:
When editing a recurring event, the error is in recurring.js file, on the line var top = …

_init_set_value:function(node, value, ev){ ... var top = node.getElementsByTagName("FORM")[0]; //<--- this line throws an error // node is a <TextNode with value "undefined"

This HTML inside lightbox is the problem

[code]

Description
Disabled
Repeat event
undefined
Time period
[/code]

In dhtmlxscheduler_debug.js this code finds the sibling for div area_1329318503533 and that sibling div is “undefined”

var sns = this.config.lightbox.sections; for (var i=0; i < sns.length; i++) { var node=document.getElementById(sns[i].id).nextSibling; var block=this.form_blocks[sns[i].type]; block.set_value.call(this,node,ev[sns[i].map_to],ev, sns[i]); if (sns[i].focus) block.focus.call(this,node); }

Can you please help?

Attaching a screen shot of Firebug error

thanks
Abhi