Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Event/GraphQL/ListingEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

final class ListingEvents
{
/**
* @Event("Symfony\Component\EventDispatcher\GenericEvent")
*
* @var string
*/
const PRE_BUILD = 'pimcore.datahub.graphql.listing.preBuild';

/**
* @Event("Pimcore\Bundle\DataHubBundle\Event\GraphQL\Model\ListingEvent")
*
Expand Down
8 changes: 8 additions & 0 deletions src/GraphQL/Resolver/QueryType.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use Pimcore\Model\DataObject\Service;
use Pimcore\Model\Translation;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;

final class QueryType
{
Expand Down Expand Up @@ -370,6 +371,13 @@ public function resolveListing($value = null, $args = [], $context = [], ?Resolv
$this->getGraphQlService()->getLocaleService()->setLocale($args['defaultLanguage']);
}

$event = new GenericEvent(
arguments: $args,
);
Comment on lines +374 to +376
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GenericEvent is referenced without an import or a fully-qualified class name, which will cause a runtime error (Class "...\GenericEvent" not found). Add use Symfony\Component\EventDispatcher\GenericEvent; at the top of the file (or reference it via the full namespace).

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@valantic-cx-alps Could you please add use Symfony\Component\EventDispatcher\GenericEvent;? Thanks


$this->eventDispatcher->dispatch($event, ListingEvents::PRE_BUILD);
$args = $event->getArguments();

$modelFactory = $this->getGraphQlService()->getModelFactory();
$listClass = 'Pimcore\\Model\\DataObject\\' . ucfirst($this->class->getName()) . '\\Listing';
/** @var Listing\Concrete $objectList */
Expand Down
Loading