DHTMLX 5 bug: Timeline/PHP/CI integration?


#1

Hi,

We’re using DHTMLX Scheduler since version 4.3. We just upgraded to version 5 and we are encountering some problem related to the integration with the server. If we downgrade to the last 4.x Scheduler version it works again.

Our environment: Ubuntu server with PHP 5.5 + MySQL 5.7

Screen capture example: https://youtu.be/GlcYl9qi6is

Steps explained:

  • Delete an event (scheduler.deleteEvent(event_id);). As you can see in the browser console no event is fired.
  • Refresh scheduler events and the event is not removed.
  • Delete an event. Edit an event.
  • Refresh scheduler events and the removed event is there, the edited one is there plus a new one.
  • After a browser F5 all is working again, we can delete/edit events perfectly.

It happens after we create multiple events directly in the database and refreshing the scheduler, not creating it by standard lightbox.
We create the events like this:

 xhr_call('post', 'planificacio/create_events'); ?>', params).done(function(ok)
 {
      load_scheduler(undefined, undefined, undefined, 'Planificacions desades correctament');
      scheduler.endLightbox(false, null);
 });

Our integration
We have this method in our PHP controller:

public function get_events($up = '', $etiqueta = '') {
     require_once("assets/dhtmlx/dhtmlxConnector/codebase/scheduler_connector.php");
     require_once("assets/dhtmlx/dhtmlxConnector/codebase/db_phpci2.php");
     require_once("Plan_events.php");
     DataProcessor::$action_param ="dhx_editor_status";
     $this->load->model('example_model');
     $conn = new SchedulerConnector($this->db, "PHPCI");

     $conn->event->attach(new Plan_events()); // Update/Delete/...
     if ($this->input->get('editing')) $events = array();
     else $events = $this->example_model->get_events($this->input->get('from'), $this->input->get('to'));
     $conn->render_array($events,"CalendariProfessionalID", "dataInici,dataFi,professionalNom,...");
 }

In the view the scheduler is defined like this:

 scheduler.init('calendari', new Date(),"timeline_week");
 scheduler.setLoadMode('week');
 var dp = new dataProcessor("plan_unitat/get_events);
 dp.action_param ="dhx_editor_status"; // Integració CI
 dp.init(scheduler);
 scheduler.load("plan_unitat/get_events");

#2

Hi? :cold_sweat: :wave:


#3

Hello,

Sorry for a delay.
Do you have a license? If yes, could you please tell me the number?


#4

Sent by private message. Could you reproduce the bug?
Thx


#5

Hi,

Unfortunately we haven’t info about the license that you sent me. It seems that it is outdated.

I asked the license to send you a new version 5.1 before its official release. But the release has already happened. So please download the latest version and check if the issue occurs there. There was a similar fix, perhaps it helps you too. I still didin’t reproduce your bug.


#6

Our license only let us download 5.0 pro, not 5.1 or later versions. We’d like to update the license and continue using newer versions of DHTMLX Scheduler but not if this bug isn’t resolved, 5.0 is useless to us. Is there a way to try 5.1 timeline to see if that works before buying the licenses?

Thx


#7

Unfortunately we cannot recreate your described problem locally.
Could you please, provide a complete demo, where the problem could be reconstructed so we can check it (also with the latest version of the dhtmlxScheduler) and fix it or we can be sure that the update will solve your problem.


#8

Hi again,

As I mentioned, we haven’t info about the license number that you sent me because the license with such number was bought several years ago. But if you can download 5.0 pro, seems this is not entirely true and you had an extended access to the support recently.

To figure it out please contact info@dhtmlx.com and specify the last support extension number. Also, you can refer to this topic in the letter. Maybe our command will be able to provide you a way to try 5.1 timeline and check this bug. If the bug is fixed in this version, you will know for sure that you need the license.


#9

I tested the 5.1.1 evaluation version and the bug is there :frowning: You can try this demo:

Access our Intranet:

  1. Open https://icsgirona.cat:10443/remote/login?lang=en .
  2. Login with username ‘04323471T’ and password ‘04323471T’.
  3. Click on icon “GT”.
  4. Change browser URL replacing (…)176/girh_gt(…) with (…)176/girh_gt_demo(…).

Now you are on the scheduler (5.1.1 evaluation version, demo database). To reproduce the bug:

  1. Double click any free space to create a new event. If a notification message appears click OK.
  2. A custom lightbox appears. Click on lower “DEMO” link. It will close the lightbox.
  3. Delete an event right clicking on it and clicking the contextual menu “Planificacio > Esborra Planificacio”.
    The event is apparently removed but it doesn’t trigger the database delete and if you refresh the scheduler the event is there. It doesn’t happens before clicking the “DEMO” link.

It was working ok before DHTMLX Scheduler version 5.0.

Notes:

  • The “DEMO” link executes that:
    function demo_exit()
    {
    load_scheduler(undefined, undefined, undefined, ‘Exit’);
    scheduler.endLightbox(false, null);
    $(’#modal-planificacio’).modal(‘hide’);
    }
  • The contextual menu “Planificacio > Esborra Planificacio” executes that:
    scheduler.deleteEvent(event_id);

#10

Hello,

Thank you for the description, the issue is reproduced. We’ve added info about the problem to the bug tracker. You will reply you in the support, please wait a bit.


#11

Hi,
I’m now able to reproduce it’s locally.
The problem happens because scheduler doesn’t clear scheduler.getState().new_event flag if you call scheduler.clearAll before closing the lightbox using scheduler.endLightbox.
In your app clearAll is called fromload_scheduler` method.

And when the new_event flag is set, the dataprocessor won’t send the update to the backend as it considers delete operation as cancel during the process of creation of new event.

http://snippet.dhtmlx.com/1f39aa249

  1. click see new_event flag button at top-left
    Result: new_event: false => ok

  2. double click empty space

  3. click while the lightbox is opened see new_event flag

  4. new_event: true => ok

  5. click Cancel button

  6. click see new_event flag
    Result: new_event: false => ok

  7. double click empty space

  8. click while the lightbox is opened see new_event flag

  9. new_event: true => ok

  10. click DEMO button

  11. click see new_event flag
    Result: new_event: true => not ok,
    the expected value is false since no event is being created

I’m checking the issue on our end now, the fix should be ready pretty soon.

As a quick workaround, you can change the order of commands in your demo_exit function:

function demo_exit()
{
  scheduler.endLightbox(false, null);
  load_scheduler(undefined, undefined, undefined, ‘Exit’);
  $(’#modal-planificacio’).modal(‘hide’);
}

then everything should also work as expected http://snippet.dhtmlx.com/10ed87b9d


#12

Hi @Dimass
pls check your support replies, I’ve sent you an updated build of the scheduler. It should fix the bug.