Skip to content

Commit 4d735bc

Browse files
committed
Merge branch 'develop'
2 parents 0b33178 + b2bd911 commit 4d735bc

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ Versioning](https://semver.org/spec/v2.0.0.html).
88

99
## [Unreleased]
1010

11+
## [1.8.1] - 2025-06-16
12+
13+
* [PR-92](https://github.com/itk-dev/kunstdatabasen/pull/92)
14+
4719: Made it possible to delete items
15+
1116
## [1.8.0] - 2025-05-13
1217

1318
* [PR-90](https://github.com/itk-dev/kunstdatabasen/pull/90)
@@ -95,7 +100,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
95100

96101
## [1.0.0] - yyyy-mm-dd
97102

98-
[Unreleased]: https://github.com/itk-dev/kunstdatabasen/compare/1.8.0...HEAD
103+
[Unreleased]: https://github.com/itk-dev/kunstdatabasen/compare/1.8.1...HEAD
104+
[1.8.1]: https://github.com/itk-dev/kunstdatabasen/compare/1.8.0...1.8.1
99105
[1.8.0]: https://github.com/itk-dev/kunstdatabasen/compare/1.7.1...1.8.0
100106
[1.7.1]: https://github.com/itk-dev/kunstdatabasen/compare/1.7.1...1.7.1
101107
[1.7.0]: https://github.com/itk-dev/kunstdatabasen/compare/1.6.8...1.7.0

config/packages/framework.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
framework:
33
secret: '%env(APP_SECRET)%'
44
#csrf_protection: true
5-
http_method_override: false
5+
http_method_override: true
66
handle_all_throwables: true
77

88
# https://symfony.com/doc/current/deployment/proxies.html

src/Controller/ItemController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,9 @@ public function edit(Request $request, Item $item, EntityManagerInterface $entit
269269
}
270270

271271
#[Route(path: '/{id}', name: 'item_delete', methods: ['DELETE'])]
272-
public function delete(Request $request, Item $item): Response
272+
public function delete(Request $request, Item $item, EntityManagerInterface $entityManager): Response
273273
{
274274
if ($this->isCsrfTokenValid('delete'.$item->getId(), $request->request->get('_token'))) {
275-
$entityManager = $this->getDoctrine()->getManager();
276275
$entityManager->remove($item);
277276
$entityManager->flush();
278277
}

src/Entity/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Item
4040
/**
4141
* @var Collection<int, Image>|Image[]
4242
*/
43-
#[ORM\OneToMany(targetEntity: Image::class, mappedBy: 'item', cascade: ['persist'])]
43+
#[ORM\OneToMany(targetEntity: Image::class, mappedBy: 'item', cascade: ['persist', 'remove'])]
4444
private Collection $images;
4545

4646
#[ORM\Column(type: Types::STRING, length: 255, nullable: true)]

0 commit comments

Comments
 (0)