Skip to content

Commit

Permalink
fix delete all button on alerts page
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Dec 4, 2024
1 parent 1d3d075 commit 75679ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions classes/AlertView/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,11 @@ protected function setUserData() {
$this->data['mp_step'] = 'mp_alert';
}
}
if (!isset($this->data['alert']) || !$this->data['alert']) {
if ($this->data['alerts']) {
$this->data['alert'] = $this->data['alerts'][0];
}
}
if ($this->data['addword'] != '' || ($this->data['step'] && count($this->data['errors']) > 0)) {
$this->data["step"] = get_http_var('this_step');
} else {
Expand Down
4 changes: 3 additions & 1 deletion www/includes/easyparliament/templates/html/alert/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,12 @@
<?php } ?>
</div>
<div class="alert-page-header__button-group">
<?php if ($keyword_alerts || $spoken_alerts || $own_member_alerts) { ?>
<form action="<?= $actionurl ?>" method="POST" class="pull-right">
<input type="hidden" name="t" value="< ?= _htmlspecialchars($alert['token']) ?>">
<input type="hidden" name="t" value="<?= _htmlspecialchars($alert['token']) ?>">
<input type="submit" class="button button--negative small" name="action" value="<?= gettext('Delete All') ?>">
</form>
<?php } ?>
<form action="<?= $actionurl ?>" method="post">
<input type="hidden" name="step" value="define">
<button type="submit" class="button small" value="<?= gettext('Create new keyword alert') ?>">
Expand Down

0 comments on commit 75679ba

Please sign in to comment.