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

Update cmd.class.php #2981

Merged
merged 1 commit into from
Nov 21, 2024
Merged
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
10 changes: 6 additions & 4 deletions core/class/cmd.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1134,10 +1134,12 @@ public function remove() {
viewData::removeByTypeLinkId('cmd', $this->getId());
dataStore::removeByTypeLinkId('cmd', $this->getId());
$eqLogic = $this->getEqLogic();
$eqLogic->setStatus(array(
'warning' => 0,
'danger' => 0,
));
if (is_object($eqLogic)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&& method_exists($eqLogic, 'setStatus')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonjour, Désolé mais je ne comprend pas la proposition.
Hello, Sorry but I don't understand the proposal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu vérifie que ta variable est un objet. Si c'est le cas tu appels la methode set Status, mais rien n'indique ici que cette méthode existe dans ton objet. Ma proposition permet juste de faire cette vérification.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La verification doit suffire dans quasiment tous les cas. Il est peut probable que l’objet n’est pas la méthode en question.

$eqLogic->setStatus(array(
'warning' => 0,
'danger' => 0,
));
}
$this->emptyHistory();
cache::delete('cmdCacheAttr' . $this->getId());
cache::delete('cmd' . $this->getId());
Expand Down