You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I click the "Clear Index Queue" button in the Index Queue backend module I get an error response from Typo3:
(1/1) TypeError
ApacheSolrForTypo3\Solr\IndexQueue\Queue::deleteItemsBySite(): Argument #1 ($site) must be of type ApacheSolrForTypo3\Solr\Domain\Site\Site, null given, called in /var/www/html/vendor/apache-solr-for-typo3/solr/Classes/Controller/Backend/Search/AbstractModuleController.php on line 231
To Reproduce
Steps to reproduce the behavior:
Have multiple sites
Go to Index Queue backend module
Click on 'Clear Index Queue'
Confirm the popup
See error
Expected behavior
A clean index queue
Used versions (please complete the following information):
TYPO3 Version: 12.4.6
EXT:solr Version: latest dev-release-12.0.x
This probably also applies to master/13 as the relevant code is the same.
Additional context
There is a fallback in AbstractModuleController->initializeAction called "autoSelectFirstSiteAndRootPageWhenOnlyOneSiteIsAvailable" which probably "hides" this bug if you only have one site.
As far as I could debug it:
AbstractModuleController->clearIndexQueueAction() tries using $this->selectedSite which is null.
The AbstractModuleController->initializeAction is responsible for setting the site but the id set in the frontend is not received in the backend. i.e. this condition is always false
if ($this->request->hasArgument('id')) {
$this->selectedPageUID = (int)$this->request->getArgument('id');
}
The id is set in the frontend, but the variable pageUID is null in IndexQueueModule/Index.html <f:form action="clearIndexQueue" additionalParams="{id: '{pageUID}'}">
That fluid variable is beeing correctly set in AbstractModuleController->initializeView() but does not reach the Index.html
I narrowed it down to the initializeAction beeing called twice:
initializeAction is called automatically by Typo3 -> creates new View
initializeView is called automatically by Typo3
initializeAction is called manually in IndexQueueModuleController->indexAction -> creates new View w/o variables from step 2
Describe the bug
When I click the "Clear Index Queue" button in the Index Queue backend module I get an error response from Typo3:
(1/1) TypeError
ApacheSolrForTypo3\Solr\IndexQueue\Queue::deleteItemsBySite(): Argument #1 ($site) must be of type ApacheSolrForTypo3\Solr\Domain\Site\Site, null given, called in /var/www/html/vendor/apache-solr-for-typo3/solr/Classes/Controller/Backend/Search/AbstractModuleController.php on line 231
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clean index queue
Used versions (please complete the following information):
This probably also applies to master/13 as the relevant code is the same.
Additional context
There is a fallback in AbstractModuleController->initializeAction called "autoSelectFirstSiteAndRootPageWhenOnlyOneSiteIsAvailable" which probably "hides" this bug if you only have one site.
As far as I could debug it:
<f:form action="clearIndexQueue" additionalParams="{id: '{pageUID}'}">
I narrowed it down to the initializeAction beeing called twice:
IMO the manual call should be deleted
ext-solr/Classes/Controller/Backend/Search/IndexQueueModuleController.php
Line 68 in 4c13753
The text was updated successfully, but these errors were encountered: