[BUG] Indexing priority is not applied when adding a new record
Describe the bug When adding a new record (it could be page or any other custom type), the indexing_priority field is not taken into account. However, if the record is reprocessed through the backend indexing queue Module, the indexing_priority is correctly applied.
To Reproduce
- Go to the TYPO3 backend
- Add a new record (make sure to define the plugin.tx_solr.index.queue."solrConfiguration".indexingPriority = 20
- Check the tx_solr_indexqueue_item table and notice that indexing_priority is not set.
- Manually reprocess the record through the backend indexing queue module.
- Check the tx_solr_indexqueue_item table again; indexing_priority is now correctly set.
Expected behavior The indexing_priority should be correctly set when a new record is added, without requiring manual reprocessing via the backend.
Used versions (please complete the following information):
- TYPO3 Version: 12.4.27
- EXT:solr Version: 12.0.5 (same code in 12.0.6)
- PHP Version: 8.2.12
- MySQL Version: 8.0.39
Additional context The issue occurs because the method ApacheSolrForTypo3\Solr\Domain\Index\Queue\QueueItemRepository::add() does not set the indexing_priority value when inserting a new record. However, QueueItemRepository::updateExistingItemByItemTypeAndItemUidAndRootPageId() does set the indexing_priority when an item is reprocessed via the backend indexing queue.