Randomly removes database details

Hi,

I’ve been working on editing this system to make it work for booking different rooms of a building.
You can see what I’ve got here: shul.co.uk/diary/

Basically, when you create an event, you can choose the rooms you want to use.
If you click ‘Filters’ at the top, you can then filter the results by selecting the rooms you want to see usage of.

But I’ve got a really strange bug, where moving/resizing an event causes it to remove the location data from the database. This only happens the first time on a page load though.
So if I load the page, and resize the event, it loses the location data. If I add the data back in, and on the same page load, I resize it again, the data doesn’t get removed.

I’ve spent hours looking through every single function called when triggering a move/resize click, but I couldn’t find anything that would cause this bug.

Any help would be so greatly appreciated!

Any ideas?

I’m really struggling with this. I’ve spent hours looking and couldn’t find anything.
Not sure if it’s my lack of using this library previously, or if it’s actually really hard to fix.

I can confirm the issue, can you post the server side code as well ? ( content of events_multiselect_options.php )

Here it is:

[code]<?php
include (’…/codebase/connector/scheduler_connector.php’);
include (’…/codebase/connector/crosslink_connector.php’);
require_once (‘config.php’);

$cross = new CrossOptionsConnector($res, $dbtype);
$cross->dynamic_loading(true);
$cross->options->render_table("user","user_id","user_id(value),username(label)");
$cross->link->render_table("event_user","event_id", "user_id,event_id");

$spaceCross = new CrossOptionsConnector($res, $dbtype);
$spaceCross->dynamic_loading(true);
$spaceCross->options->render_table("space","space_id","space_id(value),space_name(label)");
$spaceCross->link->render_table("event_space","event_id","space_id,event_id");

$scheduler = new SchedulerConnector($res, $dbtype);

$scheduler->set_options("user_id", $cross->options);
$scheduler->set_options("space_id", $spaceCross->options);

$scheduler->render_table("events_ms","event_id","start_date,end_date,event_name,rec_type,event_pid,event_length,details");

?>[/code]

Bug confirmed and fixed.
Update crosslink_connector.php with attached one, or just grab the latest connectors package from github.com/DHTMLX/connector-php
crosslink_connector.zip (1.41 KB)

Thanks so much!

You’ve been so much help recently, I really appreciate it!

May I ask what was wrong with it?

In your case, multiselect options are loaded dynamically, only when related lightbox is opened (which is a valid use-case). When item moved it triggers data update operation, but do not provide info about mutliselect options ( as they was not loaded yet ) and server side code do recognize it as “all unchecked” situation.

With fixed file, server side code will be able to correcty recognize “options not loaded yet” case, and will preserve existing options.

Ok, that makes sense. Thanks!