-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed missing event manager for form AssetEditForm.
- Loading branch information
Daniel Berthereau
authored and
Daniel Berthereau
committed
Oct 28, 2024
1 parent
811b07a
commit 3d292ac
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
application/src/Service/Form/FormWithEventManagerFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Omeka\Service\Form; | ||
|
||
use Interop\Container\ContainerInterface; | ||
use Laminas\ServiceManager\Factory\FactoryInterface; | ||
|
||
class FormWithEventManagerFactory implements FactoryInterface | ||
{ | ||
public function __invoke(ContainerInterface $services, $requestedName, array $options = null) | ||
{ | ||
$form = new $requestedName(null, $options ?? []); | ||
$form->setEventManager($services->get('EventManager')); | ||
return $form; | ||
} | ||
} |