Fix fulfilled wishes disappearing for wishlist owner #58

This commit is contained in:
grandeljay 2022-12-05 10:26:12 +01:00
parent 5089a8cc8a
commit dd0aae5938
2 changed files with 38 additions and 1 deletions

View file

@ -64,7 +64,23 @@ class Wishlist
$WHERE = isset($sql['WHERE']) ? $sql['WHERE'] : '`wishlist` = ' . $this->id; $WHERE = isset($sql['WHERE']) ? $sql['WHERE'] : '`wishlist` = ' . $this->id;
$ORDER_BY = isset($sql['ORDER_BY']) ? $sql['ORDER_BY'] : '`priority` DESC, `url` ASC, `title` ASC'; $ORDER_BY = isset($sql['ORDER_BY']) ? $sql['ORDER_BY'] : '`priority` DESC, `url` ASC, `title` ASC';
$WHERE .= ' AND (`status` IS NULL)'; /** Determine if user owns the requested wish list */
$wish_status = ' AND (`status` IS NULL)';
if ($_SESSION['user']->isLoggedIn()) {
$wishlist_ids = array_map(
function ($wishlist_data) {
return intval($wishlist_data['id']);
},
$_SESSION['user']->getWishlists()
);
if (in_array($this->id, $wishlist_ids, true)) {
$wish_status = '';
}
}
$WHERE .= $wish_status;
$this->wishes = $database $this->wishes = $database
->query( ->query(

View file

@ -24,6 +24,7 @@ $page->navigation();
<div class="ui vertical pointing fluid menu profile"> <div class="ui vertical pointing fluid menu profile">
<a class="item" data-tab="roadmap"><?= __('Roadmap') ?></a> <a class="item" data-tab="roadmap"><?= __('Roadmap') ?></a>
<a class="item" data-tab="1-0-0"><?= __('1.0.0') ?></a> <a class="item" data-tab="1-0-0"><?= __('1.0.0') ?></a>
<a class="item" data-tab="0-7-3"><?= __('0.7.3') ?></a>
<a class="item" data-tab="0-7-2"><?= __('0.7.2') ?></a> <a class="item" data-tab="0-7-2"><?= __('0.7.2') ?></a>
<a class="item" data-tab="0-7-1"><?= __('0.7.1') ?></a> <a class="item" data-tab="0-7-1"><?= __('0.7.1') ?></a>
<a class="item" data-tab="0-7-0"><?= __('0.7.0') ?></a> <a class="item" data-tab="0-7-0"><?= __('0.7.0') ?></a>
@ -175,6 +176,26 @@ $page->navigation();
</div> </div>
</div> </div>
<div class="ui tab" data-tab="0-7-3">
<div class="ui segments">
<div class="ui segment">
<h2 class="ui header"><?= __('0.7.3') ?></h2>
</div>
<div class="ui segment">
<h3 class="ui header"><?= __('Fixed') ?></h3>
<ul>
<li>
<?php
/** TRANSLATORS: Changelog: Fixed */
echo __('Fix fulfilled wishes disappearing for wishlist owner');
?>
<a href="https://github.com/grandeljay/wishthis/issues/58" target="_blank">#58</a>
</li>
</ul>
</div>
</div>
</div>
<div class="ui tab" data-tab="0-7-2"> <div class="ui tab" data-tab="0-7-2">
<div class="ui segments"> <div class="ui segments">
<div class="ui segment"> <div class="ui segment">