Correction of possible problems
Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
		@@ -54,7 +54,7 @@ class handler {
 | 
				
			|||||||
    public static function events($event) {
 | 
					    public static function events($event) {
 | 
				
			||||||
        $data = $event->get_data();
 | 
					        $data = $event->get_data();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($callbacks = local_webhooks_get_list_records()) {
 | 
					        if (!empty($callbacks = local_webhooks_get_list_records())) {
 | 
				
			||||||
            foreach ($callbacks as $callback) {
 | 
					            foreach ($callbacks as $callback) {
 | 
				
			||||||
                self::handler_callback($data, $callback);
 | 
					                self::handler_callback($data, $callback);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,7 +50,7 @@ if ($mform->is_cancelled()) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Getting the data */
 | 
					/* Getting the data */
 | 
				
			||||||
$servicerecord = new stdClass();
 | 
					$servicerecord = new stdClass();
 | 
				
			||||||
if ($editing = (bool) $serviceid) {
 | 
					if (($editing = (bool) $serviceid) === true) {
 | 
				
			||||||
    $servicerecord = local_webhooks_get_record($serviceid);
 | 
					    $servicerecord = local_webhooks_get_record($serviceid);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (is_array($servicerecord->events)) {
 | 
					    if (is_array($servicerecord->events)) {
 | 
				
			||||||
@@ -69,7 +69,7 @@ if ($editing = (bool) $serviceid) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Processing of received data */
 | 
					/* Processing of received data */
 | 
				
			||||||
if ($data = $mform->get_data()) {
 | 
					if (!empty($data = $mform->get_data())) {
 | 
				
			||||||
    if (is_array($data->events)) {
 | 
					    if (is_array($data->events)) {
 | 
				
			||||||
        $events = array();
 | 
					        $events = array();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,7 +45,7 @@ if ($mform->is_cancelled()) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Processing the received file */
 | 
					/* Processing the received file */
 | 
				
			||||||
if ($data = $mform->get_data()) {
 | 
					if (!empty($data = $mform->get_data())) {
 | 
				
			||||||
    $content = $mform->get_file_content('backupfile');
 | 
					    $content = $mform->get_file_content('backupfile');
 | 
				
			||||||
    local_webhooks_restore_backup($content);
 | 
					    local_webhooks_restore_backup($content);
 | 
				
			||||||
    redirect($managerservice, new lang_string('restorefinished', 'moodle'));
 | 
					    redirect($managerservice, new lang_string('restorefinished', 'moodle'));
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user