Cannot read property 'rec_type' of undefined

Hi guys

I keep getting this error “Uncaught TypeError: Cannot read property ‘rec_type’ of undefined”
when I delete an event.
I’m attaching some code, maybe you can spot the error:

scheduler

scheduler.config.lightbox.sections = [
{name: “lesson_id”, height: 21, map_to: “lesson_id”, type: “select”, options: scheduler.serverList(“lesson_id”)},
{name:“recurring”, height:115, type:“recurring”, map_to:“rec_type”, button:“recurring”},
{name: “time”, height: 72, type: “time”, map_to: “auto” }
];
render
$scheduler->render_table(“events”, “event_id”,“start_date,end_date,event_name,lesson_id,ev_user_id,rec_type,event_pid,event_length”);

My ‘rec_type’ field is a varchar(64)

Thanks

Hi,
try the latest version of js codebase, does the issue happens with it?
s3.amazonaws.com/uploads.hipcha … 140128.zip

Hi
It is the same.
If I try to delete the event I’ve just created I get the error “Cannot read property ‘rec_type’ of undefined”, but it works after I refresh the page.
Even then the event doesn’t disappear straight away. A line goes across the event title, but no error is displayed, and if I refresh the page once again it is gone.

Please double-check the server side response for delete operation - it must be an xml like next

<data> <action type="deleted" sid="123" tid="123"> </data>

Where sid must be the id of event that was deleted.

I couldn’t find the xml but this is the object event displayed on the console when it is created:

Object {start_date: Mon Feb 24 2014 08:55:00 GMT+0000 (GMT Standard Time), end_date: Mon Feb 24 2014 10:30:00 GMT+0000 (GMT Standard Time), text: “New lesson”, id: 1393321498861, _timed: true…}
!nativeeditor_status: “inserted”
_count: 1
_inner: false
_pid_time: NaN
_sday: 0
_sorder: 0
_text_style: “font-weight:bold;”
_timed: true
end_date: Mon Feb 24 2014 10:30:00 GMT+0000 (GMT Standard Time)
event_length: “”
event_pid: “”
id: 1393321498861
rec_pattern: “”
rec_type: “”
start_date: Mon Feb 24 2014 08:55:00 GMT+0000 (GMT Standard Time)
text: “New lesson”
proto: Object

Try to use Firebug or Chrome debug console. On network tab you can check all requests to server side and their responses.

I have moved to a different server and the same code was working on the old one.
Now I’m getting this error. Is this related to the permissions on the server?

<?xml version='1.0' ?>

Warning: error_log(log.txt): failed to open stream: Permission denied in /var/www/sites/dev.school360.co.uk/www/scheduler/codebase1/tools.php on line 205

Yep, on new server php has not write access to the connector’s folder and can’t write a log file. You can change folder access, or just comment enable_log command ( connector itself doesn’t need write access, it is necessary only for logging )

Hi,

I have the exact same error but only in Chrome.
The PHP rply is a XML as you say:

<?xml version='1.0' ?>

I use Scheduler 4.0.
It works well on FF and IE. Only Chrome shows this error and we need to refresh calendar to make the event disappear.

Are you using custom code or connector for server side operations ?
In first case - please check that content type of response is “text/xml”

we use connector and answer is XML:

Connection:Keep-Alive
Content-Type:text/xml
Date:Tue, 18 Mar 2014 12:24:25 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.2.22 (Win32) PHP/5.4.26 mod_ssl/2.2.22 OpenSSL/0.9.8t
Transfer-Encoding:chunked
X-Powered-By:PHP/5.4.26

RESPONSE:

<?xml version='1.0' ?>

we use connector and answer is XML:

Connection:Keep-Alive
Content-Type:text/xml
Date:Tue, 18 Mar 2014 12:24:25 GMT
Keep-Alive:timeout=5, max=100
Server:Apache/2.2.22 (Win32) PHP/5.4.26 mod_ssl/2.2.22 OpenSSL/0.9.8t
Transfer-Encoding:chunked
X-Powered-By:PHP/5.4.26

RESPONSE:

<?xml version='1.0' ?>

Response looks correct :expressionless:
Is the demo page available online ? ( you can send me a PM with details )

I can confirm the issue
Fixed version will be available in next few days.

Hi,
please find attached a fix for this issue. Add this file in your project after “dhtmlxscheduler.js”.
Next release of the scheduler will include this fix.
Thanks for the problem report!
dhtmlxscheduler_delete.js.zip (390 Bytes)

thanks. I confirm that the patch corrected the problem.