Skip to content
Snippets Groups Projects
Commit 88f4f2e4 authored by Jürgen Haas's avatar Jürgen Haas Committed by Jürgen Haas
Browse files

Issue #3343459 by jurgenhaas, djdevin, danielspeicher: TypeError: Argument 2...

Issue #3343459 by jurgenhaas, djdevin, danielspeicher: TypeError: Argument 2 passed to Drupal\eca_content\HookHandler::prepareForm() must be of the type string, null given
parent 8cf42e41
No related branches found
No related tags found
No related merge requests found
......@@ -21,9 +21,9 @@ class ContentEntityPrepareForm extends ContentEntityBaseEntity implements FormEv
/**
* The operation.
*
* @var string
* @var string|null
*/
protected string $operation;
protected ?string $operation;
/**
* The form state.
......@@ -39,12 +39,12 @@ class ContentEntityPrepareForm extends ContentEntityBaseEntity implements FormEv
* The entity.
* @param \Drupal\eca\Service\ContentEntityTypes $entity_types
* The entity types.
* @param string $operation
* @param string|null $operation
* The operation.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state.
*/
public function __construct(ContentEntityInterface $entity, ContentEntityTypes $entity_types, string $operation, FormStateInterface $form_state) {
public function __construct(ContentEntityInterface $entity, ContentEntityTypes $entity_types, ?string $operation, FormStateInterface $form_state) {
parent::__construct($entity, $entity_types);
$this->operation = $operation;
$this->formState = $form_state;
......@@ -53,10 +53,10 @@ class ContentEntityPrepareForm extends ContentEntityBaseEntity implements FormEv
/**
* Gets the operation.
*
* @return string
* @return string|null
* The operation.
*/
public function getOperation(): string {
public function getOperation(): ?string {
return $this->operation;
}
......
......@@ -157,12 +157,12 @@ class HookHandler extends BaseHookHandler {
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity.
* @param string $operation
* @param string|null $operation
* The operation.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state.
*/
public function prepareForm(EntityInterface $entity, string $operation, FormStateInterface $form_state): void {
public function prepareForm(EntityInterface $entity, ?string $operation, FormStateInterface $form_state): void {
if ($entity instanceof ContentEntityInterface) {
$this->triggerEvent->dispatchFromPlugin('content_entity:prepareform', $entity, $this->entityTypes, $operation, $form_state);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment