Hi, I worked on a API Script. I want to delete an Additional Template from a User. So I called client_template_additional_delete but I get allways the followig error: Code: #0 /var/www/clients/client2/web41/web/ispconfig.php(131): SoapClient->__call('client_template...', Array) #1 {main} The following Code I used: PHP: try{ /* Connect to SOAP Server */ $client = new SoapClient( null, array( 'location' => $soap_url, 'uri' => $soap_uri, 'exceptions' => 1, 'stream_context'=> stream_context_create( array('ssl'=> array( 'verify_peer'=>false, 'verify_peer_name'=>false)) ), 'trace' => false ) ); /* Authenticate with the SOAP Server */ $session_id = $client->login( $soapuser, $soappassword ); } catch (SoapFault $e) { $error = 'SOAP Error: ' . $e->getMessage(); } try{ $client_templates = $client->client_template_additional_delete($session_id,'30','3') ; } catch (Exception $e) { print_r($e->getTraceAsString()) ; } Any suggestion for me? What am I doing wrong? Greets
Hi, nothing happend with PHP: 'trace' => true Same error message. ( #0 /var/www/clients/client2/web41/web/ispconfig.php(131): SoapClient->__call('client_template...', Array) #1 {main} )
Hi, done, nothing changed. Any other api call I preform going without any error. PHP: $record = $client->get_function_list($session_id); print_r($record) ; give me the function list. It seems to be a problem with "client_template_additional_delete". "client_template_additional_add" also with no problem.
Not really. As a first step, you might ant to look at the apache error.log of the ispconfig server if you find any corresponding errors there. If there are no errors, then you might have to add some debug code into the function itself to see why and where it fails. the remote functions are in the files in /usr/local/ispconfig/interface/lib/classes/remote.d/
My latest commit should have fixed this: https://git.ispconfig.org/ispconfig/ispconfig3/commit/a9ce366b6652287db7d32bfe6e2824f25c0200c5
Hi, you are a bit faster! (Danke für die schnelle Hilfe )! I found the same Solution, but it take a moment longer. Now it works!
Ok, one last time. I found a bug At the moment: PHP: $sql = "DELETE FROM `client_template_assigned` WHERE `assigned_template_id` = ? AND `client_id` = ?"; $app->db->query($sql, $assigned_template_id, $client_id); $affected_rows = $app->db->affectedRows(); NEW: PHP: $sql = "DELETE FROM `client_template_assigned` WHERE `assigned_template_id` = ? AND `client_id` = ?"; $app->db->query($sql, $check, $client_id); $affected_rows = $app->db->affectedRows(); The 'assigned_template_id' field in the database is not the same as the '$assigned_template_id' var that we send to the api. (Auf Deutsch: An die API wird ja die template_id (aus der DB 'client_template_id') übergeben. Diese id ist nicht die selbe wie die assigned_template_id (diese ist einmalig). Diese wird zusätzlich ja noch beim Check abgefragt, daher passt es sich ganz gut, wie ich dachte.) Is that right, or I am wrong?
Not sure about this. Deleting normally is done by the primary id of an entry, but in this case it might make more sense using the template id as you suggested.