summaryrefslogtreecommitdiff
path: root/resources/views
diff options
context:
space:
mode:
authorGreg Roach <greg@subaqua.co.uk>2022-10-30 21:03:33 +0000
committerGreg Roach <greg@subaqua.co.uk>2022-10-30 21:03:33 +0000
commit504055284fcef1c6d50f172e3cb3fa077cc9c7a8 (patch)
tree822fb9d489e094fdbcc7dff9ecb582568ac960de /resources/views
parente765e953833fe5c74f7859cf5bfca2f25c4eeaab (diff)
downloadwebtrees-504055284fcef1c6d50f172e3cb3fa077cc9c7a8.tar.gz
webtrees-504055284fcef1c6d50f172e3cb3fa077cc9c7a8.tar.bz2
webtrees-504055284fcef1c6d50f172e3cb3fa077cc9c7a8.zip
Fix: 'Cancel' button goes to wrong URL for reorder children
Diffstat (limited to 'resources/views')
-rw-r--r--resources/views/edit/reorder-children.phtml4
-rw-r--r--resources/views/modules/relatives/family.phtml2
2 files changed, 4 insertions, 2 deletions
diff --git a/resources/views/edit/reorder-children.phtml b/resources/views/edit/reorder-children.phtml
index b0b3d33d32..031ba93656 100644
--- a/resources/views/edit/reorder-children.phtml
+++ b/resources/views/edit/reorder-children.phtml
@@ -13,6 +13,7 @@ use Fisharebest\Webtrees\View;
/**
* @var Family $family
* @var string $title
+ * @var string $url
*/
?>
@@ -20,6 +21,7 @@ use Fisharebest\Webtrees\View;
<h2 class="wt-page-title"><?= $title ?></h2>
<form method="post" action="<?= e(route(ReorderChildrenAction::class, ['tree' => $family->tree()->name(), 'xref' => $family->xref()])) ?>" class="wt-page-content">
+ <input type="hidden" name="url" value="<?= e($url) ?>">
<div class="wt-sortable-list">
<?php foreach ($family->facts(['CHIL'])->filter(static fn (Fact $fact): bool => $fact->target() instanceof Individual) as $fact) : ?>
<div class="card my-2 wt-sortable-item" data-wt-sort-by-date="<?= $fact->target()->getBirthDate()->julianDay() ?>">
@@ -47,7 +49,7 @@ use Fisharebest\Webtrees\View;
<?= /* I18N: A button label. */ I18N::translate('sort by date of birth') ?>
</button>
- <a class="btn btn-secondary" href="<?= e($family->url()) ?>">
+ <a class="btn btn-secondary" href="<?= e($url) ?>">
<?= view('icons/cancel') ?>
<?= /* I18N: A button label. */ I18N::translate('cancel') ?>
</a>
diff --git a/resources/views/modules/relatives/family.phtml b/resources/views/modules/relatives/family.phtml
index e97af17b59..00db1b6e30 100644
--- a/resources/views/modules/relatives/family.phtml
+++ b/resources/views/modules/relatives/family.phtml
@@ -231,7 +231,7 @@ use Fisharebest\Webtrees\Services\RelationshipService;
<?php if ($family->children()->count() > 1) : ?>
<br>
- <a href="<?= e(route(ReorderChildrenPage::class, ['tree' => $family->tree()->name(), 'xref' => $family->xref()])) ?>">
+ <a href="<?= e(route(ReorderChildrenPage::class, ['tree' => $family->tree()->name(), 'xref' => $family->xref(), 'url' => $individual->url() . '#tab-relatives'])) ?>">
<?= I18N::translate('Re-order children') ?>
</a>
<?php endif; ?>