Dataprocessor UPDATE not firing

During init of the scheduler, I have the following code to create my dataprocessor

var dp = new dataProcessor("sch_events.php");
dp.init(scheduler);
dp.setTransactionMode("POST");

I created sch_events.php to accept the POST events from the Scheduler, and I have that logging every POST that is received as well as handling the database updates.

I am getting POSTs for “inserted” and am successfully inserting records into the database.

But, I am not getting any POST for “updated”

Is there something else that I should be setting in my init to make sure that updates generate a POST ? or can you suggest any other issue I could investigate?

Thanks for any help you can provide.

Hi,
since inserts are working, updates should work either. Check browser’s console for error messages, maybe it’ll give a hint

I think it’s to do with the response I am sending back from the server-side script, becuase I have discovered that if I create an event in code and then edit it, it DOES send a POST for the update.

Looking at the EVENT Object in Firebug, I noticed that the events I created by code did not have a value for !nativeeditor_status, but the events that I had inserted and was then editing, still had a value on inserted for !nativeeditor_status

What I am sending as a response from my sch_events.php is the following

<data><action type="inserted" sid="1357751981404" tid="1315" /></data>

Have I got something incorrect in the response?

Is my response failing to trigger something that would clear the !nativeeditor_status value?

Thanks for any help you can provide.

I just noticed the following thread which sounds very similar to my issue

viewtopic.php?f=6&t=27268

Does this mean that there is an error in the library that prevents editing an event that has just been inserted?

Have I got something incorrect in the response?
Is my response failing to trigger something that would clear the !nativeeditor_status value?

Be sure that

  • response has text/xml content type
  • response starts from xml tag, there is no whitespaces before it ( it may break xml parsing in FF )

If XML response is invalid, scheduler will not send further updates for the same event object

Does this mean that there is an error in the library that prevents editing an event that has just been inserted?

In mentioned topic, error occurs because of custom code processing on server side, which doesn’t return correct new id. XML snippet which you have show above - returns correct id, so it is the different case

This is all I am doing in my code.

$XMLResponse = '<?xml version="1.0" encoding="UTF-8"?><data><action type="'.$XMLResponseType.'" sid="'.$XMLResponseSID.'" tid="'.$XMLResponseTID.'" /></data>';

echo $XMLResponse;

The variables are set before the $XMLResponse is created, but the above is all I am doing to return a response to the Scheduler.

I added the following before the echo, and everything is workng now.

header('Content-type: text/xml');

Many thanks for your help.