Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop integration with dead webservices plugin #373

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,6 @@
* -------------------------------------------------------------------------
*/

function plugin_datainjection_registerMethods() {

global $WEBSERVICES_METHOD;

$methods = ['getModel' => 'methodGetModel',
'listModels' => 'methodListModels',
'inject' => 'methodInject',
'listItemtypes' => 'methodListItemtypes'];

foreach ($methods as $code => $method) {
$WEBSERVICES_METHOD['datainjection.'.$code] = ['PluginDatainjectionWebservice', $method];
}
}


function plugin_datainjection_install() {
global $DB;

Expand Down
25 changes: 3 additions & 22 deletions inc/model.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1029,19 +1029,7 @@ function processUploadedFile($options = []) {
$this->loadSpecificModel();
$response = $this->readUploadedFile($options);
if (!$this->injectionData) {
if (!isset($options['webservice'])) {
return false;
}
return PluginWebservicesMethodCommon::Error(
$options['protocol'],
WEBSERVICES_ERROR_FAILED,
sprintf(
__(
'Not data to import',
'datainjection'
)
)
);
return false;
}

if ($mode == self::PROCESS) {
Expand All @@ -1055,15 +1043,8 @@ function processUploadedFile($options = []) {
if ($check['status']!= PluginDatainjectionCommonInjectionLib::SUCCESS) {

if ($mode == self::PROCESS) {
if (!isset($options['webservice'])) {
Session::addMessageAfterRedirect($check['error_message'], true, ERROR);
return false;
}
return PluginWebservicesMethodCommon::Error(
$options['protocol'],
WEBSERVICES_ERROR_FAILED,
$check['error_message']
);
Session::addMessageAfterRedirect($check['error_message'], true, ERROR);
return false;
}
}

Expand Down
208 changes: 0 additions & 208 deletions inc/webservice.class.php

This file was deleted.

2 changes: 0 additions & 2 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ function plugin_init_datainjection() {
// Javascript file
$PLUGIN_HOOKS['add_javascript']['datainjection'] = 'js/datainjection.js';

// Inbtegration with Webservices plugin
$PLUGIN_HOOKS['webservices']['datainjection'] = 'plugin_datainjection_registerMethods';
$INJECTABLE_TYPES = [];

}
Expand Down
Loading