Skip to content

Commit

Permalink
Merge pull request #42 from eurofurence/bugfix/34-back_button_error_n…
Browse files Browse the repository at this point in the history
…on_admin

Bugfix #34 - back button error - goodies
  • Loading branch information
RustyBraze authored Sep 8, 2024
2 parents bc43500 + d3b257c commit 924fd02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/admin/user/edit-goodie.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% block content %}
<div class="container">
<h1>
{{ m.back(url('/admin-active')) }}
{{ m.back(url(previousUrl)) }}
{{ block('title') }}: <small>{{ m.user(userdata) }}</small>
</h1>

Expand Down
4 changes: 4 additions & 0 deletions src/Controllers/Admin/UserGoodieController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ public function editGoodie(Request $request): Response

$user = $this->user->findOrFail($userId);

// Get the previous page URL (referrer)
$previousUrl = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/';

return $this->response->withView(
'admin/user/edit-goodie.twig',
[
'userdata' => $user,
'is_tshirt' => $this->config->get('goodie_type') === GoodieType::Tshirt->value,
'previousUrl' => $previousUrl
]
);
}
Expand Down

0 comments on commit 924fd02

Please sign in to comment.