Skip to content

Commit

Permalink
fix: register new subscriber in test setup factory
Browse files Browse the repository at this point in the history
  • Loading branch information
Nattfarinn committed Apr 23, 2024
1 parent eae6c1b commit 9d104aa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions eZ/Publish/Core/settings/tests/integration_legacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ services:
- ['addSubscriber', ['@eZ\Publish\Core\Search\Common\EventSubscriber\SectionEventSubscriber']]
- ['addSubscriber', ['@eZ\Publish\Core\Search\Common\EventSubscriber\TrashEventSubscriber']]
- ['addSubscriber', ['@eZ\Publish\Core\Search\Common\EventSubscriber\UserEventSubscriber']]
- ['addSubscriber', ['@Ibexa\Core\Persistence\Legacy\Content\Mapper\ResolveVirtualFieldSubscriber']]

Doctrine\Common\EventManager: ~

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,26 +103,34 @@ public function persistExternalStorageField(ResolveMissingFieldEvent $event): vo
$this->getDefaultStorageValue()
);

$result = $storage->storeFieldData(
$content->versionInfo,
$field,
$event->getContext()
);

if ($result === true) {
$storageValue = new StorageFieldValue();
$converter = $this->converterRegistry->getConverter($fieldDefinition->fieldType);
$converter->toStorageValue(
$field->value,
$storageValue
);

$this->contentGateway->updateField(
if ($field->value->data !== null) {
$result = $storage->storeFieldData(
$content->versionInfo,
$field,
$storageValue
[]
);

if ($result === true) {
$storageValue = new StorageFieldValue();
$converter = $this->converterRegistry->getConverter($fieldDefinition->fieldType);
$converter->toStorageValue(
$field->value,
$storageValue
);

$this->contentGateway->updateField(
$field,
$storageValue
);
}
}

$storage->getFieldData(
$content->versionInfo,
$field,
[]
);

$event->setField($field);
}

Expand Down

0 comments on commit 9d104aa

Please sign in to comment.