Skip to content

Commit 25ce7c5

Browse files
committed
Ignore ajax requests that do not render a panel
Signed-off-by: Philipp Daun <post@philippdaun.net>
1 parent 14e2c4c commit 25ce7c5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Dashboard.module

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,22 @@ class Dashboard extends Process implements Module
225225
}
226226
}
227227

228+
// Ignore ajax requests that are not requesting a panel render
229+
if ($this->config->ajax && !$this->input->post->dashboard) {
230+
return;
231+
}
232+
228233
// Load settings from hook
229234
$this->settings = $this->getSettings();
230235

231236
// Load panel instances from hook
232237
$this->panels = $this->getPanels();
233238

234-
if ($this->config->ajax) {
235-
if ($this->input->post->dashboard) {
236-
// Ajax request? (Re)render a single requested panel
237-
$key = $this->input->post->key;
238-
$panel = $this->input->post->panel;
239-
return $this->renderInstanceByKey($key, $panel);
240-
} else {
241-
// Disregard all other ajax requests
242-
return;
243-
}
239+
// Check if we have any panels to render via ajax
240+
if ($this->config->ajax && $this->input->post->dashboard) {
241+
$key = $this->input->post->key;
242+
$panel = $this->input->post->panel;
243+
return $this->renderInstanceByKey($key, $panel);
244244
}
245245

246246
// Set browser title

0 commit comments

Comments
 (0)