-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Found SQL error in sql-erros.log after computer deletion #17019
Comments
To reproduce from tests suite: diff --git a/tests/functional/Glpi/Inventory/Inventory.php b/tests/functional/Glpi/Inventory/Inventory.php
index 95c576353f..5ed5d1f78a 100644
--- a/tests/functional/Glpi/Inventory/Inventory.php
+++ b/tests/functional/Glpi/Inventory/Inventory.php
@@ -4931,7 +4931,7 @@ Compiled Tue 28-Sep-10 13:44 by prod_rel_team",
$services = [$mysql];
$json->content->databases_services = $services;
- $this->doInventory($json);
+ $inventory = $this->doInventory($json);
//check created databases & instances
$this->integer(countElementsInTable(\DatabaseInstance::getTable(), ['is_deleted' => 0]))->isIdenticalTo(1);
@@ -4951,6 +4951,17 @@ Compiled Tue 28-Sep-10 13:44 by prod_rel_team",
$this->array(array_pop($databases))
->string['name']->isIdenticalTo('glpi')
->integer['size']->isIdenticalTo(55000);
+
+ $computer = new \Computer();
+ global $DB;
+ $agents = $DB->request(['FROM' => \Agent::getTable()]);
+ $this->integer(count($agents))->isIdenticalTo(1);
+ $agent = $agents->current();
+ $computers_id = $agent['items_id'];
+ $this->boolean($computer->getFromDB($computers_id))->isTrue();
+ $this->boolean($computer->delete(['id' => $computers_id], true))->isTrue();
} I've not been able to find how to fix. To me, removing data in |
When creating a databse instance from the UI, without selecting any |
Not sure null is a correct solution. Having database instance back from inventory would probably create a new record; in that case, it may be better to remove instance when attached computer is purged. |
Code of Conduct
Is there an existing issue for this?
Version
10.0.15
Bug description
I was able to delete a computer from assets without any error but I found later in sql-errors.log a SQL error.
I don't think massive action context is relevant.
Relevant log output
Page URL
No response
Steps To reproduce
Your GLPI setup information
Informations sur le système, l'installation et la configuration
Server
GLPI constants
Libraries
SQL replicas
Notifications
Plugins list
Anything else?
No response
The text was updated successfully, but these errors were encountered: