Jump to content

Recommended Posts

Posted

Hi,

 

whenever an admin tick the select all, and submit services for scheduled cancelation, blesta will throw error

 

Oh noes!

Trying to get property of non-object on line 2114 in {BLESTA}/app/models/services.php

 

Seems like the service_id includes a non-numeric data (from the select all tickbox)

 

POST DATA:

_csrf_token:....
service_ids[]:all
service_ids[]:38
date:2015-10-31
action_type:term
action:schedule_cancellation

I did a quick hack in the /app/controllers/admin_client.php (around line 314), and seems like the problem goes away

private function updateServices($client, array $data) {
...
                    foreach ($data['service_ids'] as $service_id) {
                        // ignore non numeric service_id <'all'>
                        if (!is_numeric($service_id))
                            continue;
                        if ($data['action_type'] == "none") {
                            $this->Services->unCancel($service_id);
                        } else {
                            $this->Services->cancel($service_id, $vars);
                        }
                        $success = true;
                    }
...
}
Guest
This topic is now closed to further replies.
×
×
  • Create New...