Skip to content

Cannot set mappings in document event subscriber for custom fields #271

@woellundwoell

Description

@woellundwoell

Steps to reproduce

  • Create an Eventsubscriber with the function "onExtractMapping" for Pimcore\Bundle\GenericDataIndexBundle\Event\Document\ExtractMappingEvent::class
  • Configure the subscriber in service.yaml
  • Execute the "generic-data-index:update:index" command

The function "onExtractMapping" is never run through.

Reason

Wrong use of event class from "Asset-Namespace" in

use Pimcore\Bundle\GenericDataIndexBundle\Event\Asset\ExtractMappingEvent;

and thus also dispatching the wrong Event type here
$extractMappingEvent = new ExtractMappingEvent($customFields);
$this->eventDispatcher->dispatch($extractMappingEvent);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions