Skip to content

Commit

Permalink
Incorrect conditions for includeUnpublished
Browse files Browse the repository at this point in the history
- Incorrect conditions for includeUnpublished
  • Loading branch information
deanblackborough committed Nov 10, 2019
1 parent 3c40ed5 commit a769773
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/Models/ResourceTypeItemType/Summary/AllocatedExpense.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ public function subcategorySummary(
private function includeUnpublished($collection, array $parameters): Builder
{
if (
array_key_exists('include-unpublished', $parameters) === true &&
$parameters['include-unpublished'] === true
array_key_exists('include-unpublished', $parameters) === false ||
$parameters['include-unpublished'] === false
) {
$collection->where(function ($sql) {
$sql->whereNull('item_type_allocated_expense.publish_after')->
Expand Down
4 changes: 2 additions & 2 deletions app/Models/Summary/ItemType/AllocatedExpense.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ public function yearSummary(
private function includeUnpublished($collection, array $parameters): Builder
{
if (
array_key_exists('include-unpublished', $parameters) === true &&
$parameters['include-unpublished'] === true
array_key_exists('include-unpublished', $parameters) === false ||
$parameters['include-unpublished'] === false
) {
$collection->where(function ($sql) {
$sql->whereNull('item_type_allocated_expense.publish_after')->
Expand Down

0 comments on commit a769773

Please sign in to comment.