Don't fetch comments and downtimes twice in an object's detail view
The controller counts comments and downtimes on the object, which will automatically fetch comments and downtimes. After that came a call to MonitoredObject::populate() which again fetched comments and downtimes. Now the object is populated before counting comments and dowtimes. refs #8614
This commit is contained in:
parent
b501fef62b
commit
0286641369
|
@ -73,6 +73,7 @@ abstract class MonitoredObjectController extends Controller
|
|||
}
|
||||
}
|
||||
}
|
||||
$this->object->populate();
|
||||
if (count($this->object->comments) > 0 && $auth->hasPermission('monitoring/command/comment/delete')) {
|
||||
$delCommentForm = new DeleteCommentCommandForm();
|
||||
$delCommentForm
|
||||
|
@ -93,7 +94,7 @@ abstract class MonitoredObjectController extends Controller
|
|||
->setObjects($this->object)
|
||||
->handleRequest();
|
||||
$this->view->toggleFeaturesForm = $toggleFeaturesForm;
|
||||
$this->view->object = $this->object->populate();
|
||||
$this->view->object = $this->object;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue