Skip to content

Commit

Permalink
#75 Error creating Menu Item
Browse files Browse the repository at this point in the history
Fixed issues reagarding booleans in FormItem and MenuItem
  • Loading branch information
DerKnerd committed Aug 23, 2021
1 parent 32f458a commit 2d99be6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
28 changes: 18 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Changelog

# Release notes - Jinya Gallery CMS - Version 21.0.0
## User Stories
## Release notes - Jinya Gallery CMS - Version 21.0.2
### Fixed issues
* [#75](https://taiga.imanuel.dev/project/jinya-cms/issue/75) Error creating Menu Item

## Release notes - Jinya Gallery CMS - Version 21.0.1
### Fixed issues
* [#74](https://taiga.imanuel.dev/project/jinya-cms/issue/74) Wrong class on tab control for table data

## Release notes - Jinya Gallery CMS - Version 21.0.0
### User Stories
* [#22](https://taiga.imanuel.dev/project/jinya-cms/us/22) Use proper OPCache config resolution
* [#24](https://taiga.imanuel.dev/project/jinya-cms/us/24) Remove DIC
* [#31](https://taiga.imanuel.dev/project/jinya-cms/us/31) Add loading spinner
Expand All @@ -14,7 +22,7 @@
* [#70](https://taiga.imanuel.dev/project/jinya-cms/us/70) Bump Cosmo CSS
* [#73](https://taiga.imanuel.dev/project/jinya-cms/us/73) Sort extensions alphabetically

## Fixed issues
### Fixed issues
* [#27](https://taiga.imanuel.dev/project/jinya-cms/issue/27) Discard gallery does nothing
* [#30](https://taiga.imanuel.dev/project/jinya-cms/issue/30) Gallery designer needs rewrite
* [#39](https://taiga.imanuel.dev/project/jinya-cms/issue/39) Installer is buggy
Expand All @@ -23,20 +31,20 @@
* [#71](https://taiga.imanuel.dev/project/jinya-cms/issue/71) Segment page not sorting correctly
* [#72](https://taiga.imanuel.dev/project/jinya-cms/issue/72) Menu not sorting correctly

# Release notes - Jinya Gallery CMS - Version 20.0.13
## Fixed issues
## Release notes - Jinya Gallery CMS - Version 20.0.13
### Fixed issues
* [#29](https://taiga.imanuel.dev/project/jinya-cms/issue/29) Gallery designer clones, needs to pull

# Release notes - Jinya Gallery CMS - Version 20.0.12
## User Stories
## Release notes - Jinya Gallery CMS - Version 20.0.12
### User Stories
* [#28](https://taiga.imanuel.dev/project/jinya-cms/us/28) Increase gallery designer performance

## Fixed issues
### Fixed issues
* [#26](https://taiga.imanuel.dev/project/jinya-cms/issue/26) Drag targets are too small
* [#27](https://taiga.imanuel.dev/project/jinya-cms/issue/27) Discard gallery does nothing

# Release notes - Jinya Gallery CMS - Version 20.0.11
## Fixed issues
## Release notes - Jinya Gallery CMS - Version 20.0.11
### Fixed issues
* [#21](https://taiga.imanuel.dev/project/jinya-cms/issue/21) Wrong perms for tmp dir

## Release notes - Jinya Gallery CMS - Version 20.0.10
Expand Down
7 changes: 7 additions & 0 deletions src/Database/FormItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\OpenApiGeneration\Attributes\OpenApiField;
use App\OpenApiGeneration\Attributes\OpenApiModel;
use Iterator;
use Laminas\Hydrator\Strategy\BooleanStrategy;
use RuntimeException;

#[OpenApiModel(description: 'A form item is part of a form, containing information to send')]
Expand Down Expand Up @@ -127,6 +128,9 @@ public function create(): void
[
'spamFilter' => new JsonStrategy(),
'options' => new JsonStrategy(),
'isFromAddress' => new BooleanStrategy(1, 0),
'isSubject' => new BooleanStrategy(1, 0),
'isRequired' => new BooleanStrategy(1, 0),
]
);
}
Expand All @@ -150,6 +154,9 @@ public function update(): void
[
'spamFilter' => new JsonStrategy(),
'options' => new JsonStrategy(),
'isFromAddress' => new BooleanStrategy(1, 0),
'isSubject' => new BooleanStrategy(1, 0),
'isRequired' => new BooleanStrategy(1, 0),
]
);
}
Expand Down
5 changes: 3 additions & 2 deletions src/Database/MenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\OpenApiGeneration\Attributes\OpenApiRecursiveField;
use Exception;
use Iterator;
use Laminas\Hydrator\Strategy\BooleanStrategy;
use RuntimeException;

#[OpenApiModel('A menu item contains the navigation information')]
Expand Down Expand Up @@ -193,7 +194,7 @@ public function getMenu(): ?Menu
public function create(): void
{
$this->rearrange($this->position);
$this->internalCreate('menu_item');
$this->internalCreate('menu_item', ['highlighted' => new BooleanStrategy(1, 0)]);
}

private function rearrange(int $position): void
Expand Down Expand Up @@ -223,7 +224,7 @@ public function update(bool $rearrange = true): void
$this->rearrange($this->position);
}

$this->internalUpdate('menu_item');
$this->internalUpdate('menu_item', ['highlighted' => new BooleanStrategy(1, 0)]);
}

/**
Expand Down

0 comments on commit 2d99be6

Please sign in to comment.