- Issue created by @agentrickard
- First commit to issue fork.
- @elber opened merge request.
- Status changed to Needs work
about 1 year ago 6:08pm 23 August 2023 - π§π·Brazil elber Brazil
Hi I started to add event, but is missing to dispatch it.
- πΊπΈUnited States agentrickard Georgia (US)
This is a great start. The missing piece here is that we don't create or own this event, it belongs to search_api_solr.
See https://www.drupal.org/project/search_api_solr/issues/3203375 β¨ Introduce events and deprecate hooks Fixed
We need an EventSusbscriber service that response to \Drupal\search_api_solr\Event\PostCreateIndexDocumentsEvent
- First commit to issue fork.
- πΊπΈUnited States ddavisboxleitner
I have made an attempt to move the code from search_api_federated_solr_search_api_solr_documents_alter into an event subscriber.
Importantly, I had to use:
$documents = $event->getSolariumDocuments();
To get the list of documents, and at the end of the function I call:
$event->setSolariumDocuments($documents);
I was following the annotation in search_api_solr's Event class:
<?php namespace Drupal\search_api_solr\Event; /** * Event to be fired after all solarium documents * have been created for indexing. * * @code * // Add a "foo" field with value "bar" to all documents. * $documents = $event->getSolariumDocuments(); * foreach ($documents as $document) { * $document->setField('foo', 'bar'); * } * $event->setSolariumDocuments($documents): * @endcode * * @Event */ final class PostCreateIndexDocumentsEvent extends AbstractSearchApiItemsSolariumDocumentsEvent {}
- Status changed to Needs review
about 1 year ago 10:30pm 28 August 2023 - Status changed to RTBC
about 1 year ago 12:23pm 7 September 2023 - π§π·Brazil elber Brazil
Hi @ddavisboxleitner I reviewed it.
No bugs found
Changes applied correctly.I'm using drupal 10.1 version and branch 4.x
Module is ok.
Moving to RTBC.
- First commit to issue fork.
-
agentrickard β
committed faf59311 on 4.x authored by
ddavisboxleitner β
Issue #3382887 by ddavisboxleitner, elber, Rajeshreeputra, agentrickard...
-
agentrickard β
committed faf59311 on 4.x authored by
ddavisboxleitner β
- Status changed to Fixed
4 months ago 5:39pm 15 July 2024 Automatically closed - issue fixed for 2 weeks with no activity.